mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-16 20:25:26 +00:00
Catch errors (#469)
* Catch error comparing dropdown items * Update version number and release notes * Data conversion * Catch error when loading image from network * Suppress error reporting for statusCode -1
This commit is contained in:
@ -582,7 +582,16 @@ class APIFormField {
|
||||
return false;
|
||||
}
|
||||
|
||||
return item["pk"].toString() == selectedItem["pk"].toString();
|
||||
bool result = false;
|
||||
|
||||
try {
|
||||
result = item["pk"].toString() == selectedItem["pk"].toString();
|
||||
} catch (error) {
|
||||
// Catch any conversion errors
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
@ -606,7 +615,11 @@ class APIFormField {
|
||||
Map<String, dynamic> data = {};
|
||||
|
||||
try {
|
||||
data = Map<String, dynamic>.from((item ?? {}) as Map);
|
||||
if (item is Map<String, dynamic>) {
|
||||
data = Map<String, dynamic>.from(item);
|
||||
} else {
|
||||
data = {};
|
||||
}
|
||||
} catch (error, stackTrace) {
|
||||
data = {};
|
||||
|
||||
|
Reference in New Issue
Block a user