1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

Fixed error triggered when empty string is parsed as null

This commit is contained in:
2024-07-07 19:07:03 +04:00
parent 81c66134a1
commit e1026fd108

View File

@@ -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!');
}