diff options
| author | historia <[not public]> | 2026-07-05 18:52:51 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-05 18:52:51 -0400 |
| commit | 6bd5365cc22f84c047c1585e3f54571af46f53e5 (patch) | |
| tree | 72df0934c72baa1e31817d7db999832c6efb115f /internal/admin/static/cardeditor.js | |
| parent | 9b54188970c51070d86f4c87e909ea7836c86f07 (diff) | |
| download | thehouseoficarus-6bd5365cc22f84c047c1585e3f54571af46f53e5.tar.gz | |
feat: renameable directories and files in admin gui
Diffstat (limited to 'internal/admin/static/cardeditor.js')
| -rw-r--r-- | internal/admin/static/cardeditor.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/admin/static/cardeditor.js b/internal/admin/static/cardeditor.js index 8ff5eaf..5e0c7cb 100644 --- a/internal/admin/static/cardeditor.js +++ b/internal/admin/static/cardeditor.js @@ -199,13 +199,13 @@ function ced_setPathInData(ed, dataPath, value) { if (!ed || !dataPath) return; var m = dataPath.match(/^(.+)\[(\d+)\]\.(.+)$/); if (m) { - if (!ed[m[1]]) ed[m[1]] = []; - if (!ed[m[1]][m[2]]) ed[m[1]][m[2]] = {}; + if (!ed[m[1]] || !Array.isArray(ed[m[1]])) return; + if (!ed[m[1]][m[2]]) return; ed[m[1]][m[2]][m[3]] = value; } else { var m2 = dataPath.match(/^(.+)\.(.+)$/); if (m2) { - if (!ed[m2[1]]) ed[m2[1]] = {}; + if (ed[m2[1]] === undefined || ed[m2[1]] === null) return; ed[m2[1]][m2[2]] = value; } else { ed[dataPath] = value; |
