This commit is contained in:
Oliver Walters committed 2023-04-21 21:09:02 +10:00
1 parent 399d16f488
commit 061586e258
2 files changed
+7 -18

No files matched your search

+6 -17
View File
@@ -77,32 +77,21 @@ class InvenTreeModel {
if (subKey.isNotEmpty) {
if (!data.containsKey(subKey)) {
sentryReportMessage(
"getValue() called with invalid subKey",
context: {
"model": URL,
"key": key,
"subKey": subKey
}
);
debug("JSON data does not contain subKey '$subKey' for key '$key'");
return backup;
}
data = (data[subKey] ?? {}) as Map<String, dynamic>;
dynamic sub_data = data[subKey];
if (sub_data is Map<String, dynamic>) {
data = (data[subKey] ?? {}) as Map<String, dynamic>;
}
}
if (data.containsKey(key)) {
return data[key];
} else {
sentryReportMessage(
"getValue() called with invalid key",
context: {
"model": URL,
"key": key,
"subKey": subKey
}
);
debug("JSON data does not contain key '$key' (subKey '${subKey}')");
return backup;
}
+1 -1
View File
@@ -232,7 +232,7 @@ class InvenTreeStockItem extends InvenTreeModel {
});
}
int get status => getInt("staus");
int get status => getInt("status");
String get packaging => getString("packaging");