mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-09 20:12:59 +00:00
Fix crash with reading invalid JSON files
This commit is contained in:
@@ -1622,7 +1622,12 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/json","tiddlerdeserializer",{
|
||||
}
|
||||
return true;
|
||||
},
|
||||
data = {};
|
||||
try {
|
||||
data = JSON.parse(text);
|
||||
} catch(e) {
|
||||
// Ignore JSON parse errors
|
||||
}
|
||||
if($tw.utils.isArray(data) && isTiddlerArrayValid(data)) {
|
||||
return data;
|
||||
} else if(isTiddlerValid(data)) {
|
||||
|
||||
Reference in New Issue
Block a user