ldtk
ldtk copied to clipboard
Crash + Json: Tileset rectangles are able to point to a nonexistent tileset definition
-
Crash For any instances where TilesetRectangle icon is used (
IntGridValueDefinition,EnumValueDefinition,EntityDefinition,FieldInstanceAutoLayerRuleGroup), If I delete its tileset definition, but check back on it to readjust, I get a crash, likely due to reading a tileset definition that has become null. (see video) -
Json In addition to the crash, these rectangle objects can have their uid still point to a uid tileset that no longer exists, which can cause unexpected behaviour in an importer. I can safely check if the definition doesn't exist if the uid isn't in its dictionary lookup, but it hasn't been a scenario I've had to account for before. I think the right thing to do in this situation is: "When a tileset definition is deleted, for all tileset rectangles that use this tileset def, turn them null"
https://github.com/deepnight/ldtk/assets/55564581/e906fa82-78b2-4921-bd45-3d1023ac0575
Stack:
LDtk version: 1.5.3-64bits
Cannot read properties of undefined (reading 'embedAtlas')
TypeError
TypeError: Cannot read properties of undefined (reading 'embedAtlas')
at ui_modal_panel_EditEntityDefs.updateEntityForm (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303398:10)
at ui_modal_panel_EditEntityDefs.selectEntity (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303011:8)
at new ui_modal_panel_EditEntityDefs (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:302847:9)
at page_Editor.onAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:234605:5)
at App.executeAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:3632:24)
at HTMLButtonElement.<anonymous> (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:233079:11)
at HTMLButtonElement.dispatch (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:43064)
at v.handle (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:41048)
Processes:
#0 App
|--- #2 page.Editor
|--- #3 misc.FileWatcher
|--- #4 display.WorldRender
|--- #5 display.LevelRender
|--- #6 display.Camera
|--- #7 display.Rulers[--]
|--- #8 tool.SelectionTool[--]
|--- #9 tool.lt.DoNothing[--]
|--- #10 WorldTool
|--- #11 tool.PanView[--]
|--- #12 tool.lt.EntityTool[--]
|--- #102 ui.modal.panel.EditTilesetDefs
|--- #109 ui.LastChance
|--- #110 display.EntityRender
|--- #111 display.EntityRender
|--- #112 display.EntityRender
|--- #113 display.EntityRender
|--- #114 display.EntityRender
|--- #115 display.EntityRender
|--- #116 display.EntityRender
|--- #117 display.EntityRender
|--- #118 display.EntityRender
|--- #119 display.EntityRender
|--- #120 display.EntityRender
|--- #121 display.EntityRender
|--- #122 display.EntityRender
|--- #123 display.EntityRender
|--- #124 display.EntityRender
|--- #125 display.EntityRender
|--- #126 display.EntityRender
|--- #127 display.EntityRender
|--- #128 display.EntityRender
|--- #129 display.EntityRender
|--- #130 display.EntityRender
|--- #131 display.EntityRender
|--- #132 display.EntityRender
|--- #133 display.EntityRender
|--- #134 display.EntityRender
|--- #135 display.EntityRender
|--- #136 display.EntityRender
|--- #139 ui.Tip
|--- #140 ui.modal.panel.EditEntityDefs
Log:
[USERACTION] Closed panel #87 ui.modal.panel.EditTilesetDefs
[FILE] Reading HTML template editEntityDefs from cache
[FILE] Reading HTML template fieldDefsForm from cache
[FILE] Reading HTML template pivotEditor from cache
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[FILE] Reading HTML template pivotEditor from cache
[FILE] Reading HTML template pivotEditor from cache
[FILE] Reading HTML template pivotEditor from cache
[FILE] Reading HTML template pivotEditor from cache
[FILE] Reading HTML template pivotEditor from cache
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[USERACTION] Opened panel #102 ui.modal.panel.EditTilesetDefs
[USERACTION] Closed panel #92 ui.modal.panel.EditEntityDefs
[FILE] Reading HTML template editTilesetDefs from cache
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[WARNING] Last chance for: Tileset SunnyLand_by_Ansimuz_extended deleted
[EVENT] TilesetDefRemoved 199
[EVENT] LevelJsonCacheInvalidated
[RENDER] Rendering world level fields data.Level#f80e4bc0-66b0-11ec-b121-b327a018109c "Entities_demo"...
[WARNING] Full level render requested
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[RENDER] Rendering world bg...
[USERACTION] Opened panel #140 ui.modal.panel.EditEntityDefs
[USERACTION] Closed panel #102 ui.modal.panel.EditTilesetDefs
[FILE] Reading HTML template editEntityDefs from cache
[FILE] Reading HTML template fieldDefsForm from cache
[GENERAL] Page started: page.CrashReport()
[FILE] Loading page template: crashReport from C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/tpl/pages/crashReport.html
[ERROR] Cannot read properties of undefined (reading 'embedAtlas') (TypeError)
[ERROR] TypeError: Cannot read properties of undefined (reading 'embedAtlas')
at ui_modal_panel_EditEntityDefs.updateEntityForm (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303398:10)
at ui_modal_panel_EditEntityDefs.selectEntity (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303011:8)
at new ui_modal_panel_EditEntityDefs (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:302847:9)
at page_Editor.onAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:234605:5)
at App.executeAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:3632:24)
at HTMLButtonElement.<anonymous> (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:233079:11)
at HTMLButtonElement.dispatch (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:43064)
at v.handle (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:41048)
[GENERAL]
#0 App
|--- #2 page.Editor
|--- #3 misc.FileWatcher
|--- #4 display.WorldRender
|--- #5 display.LevelRender
|--- #6 display.Camera
|--- #7 display.Rulers[--]
|--- #8 tool.SelectionTool[--]
|--- #9 tool.lt.DoNothing[--]
|--- #10 WorldTool
|--- #11 tool.PanView[--]
|--- #12 tool.lt.EntityTool[--]
|--- #102 ui.modal.panel.EditTilesetDefs
|--- #109 ui.LastChance
|--- #110 display.EntityRender
|--- #111 display.EntityRender
|--- #112 display.EntityRender
|--- #113 display.EntityRender
|--- #114 display.EntityRender
|--- #115 display.EntityRender
|--- #116 display.EntityRender
|--- #117 display.EntityRender
|--- #118 display.EntityRender
|--- #119 display.EntityRender
|--- #120 display.EntityRender
|--- #121 display.EntityRender
|--- #122 display.EntityRender
|--- #123 display.EntityRender
|--- #124 display.EntityRender
|--- #125 display.EntityRender
|--- #126 display.EntityRender
|--- #127 display.EntityRender
|--- #128 display.EntityRender
|--- #129 display.EntityRender
|--- #130 display.EntityRender
|--- #131 display.EntityRender
|--- #132 display.EntityRender
|--- #133 display.EntityRender
|--- #134 display.EntityRender
|--- #135 display.EntityRender
|--- #136 display.EntityRender
|--- #139 ui.Tip
|--- #140 ui.modal.panel.EditEntityDefs
|--- #141 page.CrashReport
[FILE] Cleared all file watches