mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-17 23:31:22 +00:00
Fix jsonset crash when applied to primitive types
See https://talk.tiddlywiki.org/t/final-checks-before-release-of-v5-3-2/8560/7
This commit is contained in:
@@ -273,7 +273,10 @@ function setDataItem(data,indexes,value) {
|
||||
lastIndex = $tw.utils.parseInt(lastIndex);
|
||||
if(lastIndex < 0) { lastIndex = lastIndex + current.length };
|
||||
}
|
||||
current[lastIndex] = value;
|
||||
// Only set indexes on objects and arrays
|
||||
if(typeof current === "object") {
|
||||
current[lastIndex] = value;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user