mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-20 22:28:45 +00:00
Add null-pointer check in getFieldAndTable (but be careful downstream...)
This commit is contained in:
@ -93,6 +93,11 @@ class TableUtils
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public static getFieldAndTable(tableMetaData: QTableMetaData, fieldName: string): [QFieldMetaData, QTableMetaData]
|
public static getFieldAndTable(tableMetaData: QTableMetaData, fieldName: string): [QFieldMetaData, QTableMetaData]
|
||||||
{
|
{
|
||||||
|
if(fieldName == null || tableMetaData == null)
|
||||||
|
{
|
||||||
|
return ([null, null]);
|
||||||
|
}
|
||||||
|
|
||||||
if (fieldName.indexOf(".") > -1)
|
if (fieldName.indexOf(".") > -1)
|
||||||
{
|
{
|
||||||
const nameParts = fieldName.split(".", 2);
|
const nameParts = fieldName.split(".", 2);
|
||||||
@ -110,7 +115,7 @@ class TableUtils
|
|||||||
return ([tableMetaData.fields.get(fieldName), tableMetaData]);
|
return ([tableMetaData.fields.get(fieldName), tableMetaData]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (null);
|
return ([null, null]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user