Fixed error triggered when empty string is parsed as null

This commit is contained in:
koloml committed 2024-07-07 19:07:03 +04:00
1 parent 81c66134a1
commit e1026fd108
1 file changed
+4
@@ -93,6 +93,10 @@ class MaintenanceProfile extends StorageEntity {
try {
importedObject = JSON.parse(exportedString);
} catch (e) {
// Error will be sent later, since empty string could be parsed as nothing without raising the error.
}
if (!importedObject) {
throw new Error('Invalid JSON!');
}