Skip to content

Guard against dead variables container in compact object/instance editors#8484

Merged
4ian merged 1 commit intomasterfrom
investigate-and-fix-error-boundary-bug
Apr 5, 2026
Merged

Guard against dead variables container in compact object/instance editors#8484
4ian merged 1 commit intomasterfrom
investigate-and-fix-error-boundary-bug

Conversation

@4ian
Copy link
Copy Markdown
Owner

@4ian 4ian commented Apr 4, 2026

Motivation

  • Prevent crashes when accessing variables of objects or instances that may have become invalid by guarding against dead pointers returned by object.getVariables() or instance.getVariables().
  • Ensure the variables list UI only renders when a valid variables container is available to avoid undefined behavior in the compact editors.

Description

  • Import exceptionallyGuardAgainstDeadObject from ../../Utils/IsNullPtr and use it to sanitize object.getVariables() and instance.getVariables() into variablesContainer before use.
  • Use variablesContainer instead of direct calls to getVariables() when rendering VariablesList and when handling the object variables TopLevelCollapsibleSection to conditionally render that section only when the container is valid.
  • Keep the variables list ref and add behavior intact while preventing usage of a potentially dead object pointer.

Testing

  • Ran the project's test suite with yarn test, and all tests passed.
  • Ran the linter with yarn lint, and no linting errors were reported.
  • Performed a development build with yarn build, which completed successfully.

Codex Task

@4ian 4ian marked this pull request as ready for review April 5, 2026 08:56
@4ian 4ian merged commit a3b766d into master Apr 5, 2026
6 checks passed
NBForgeLab added a commit to NBForgeLab/GDevelop that referenced this pull request Apr 5, 2026
* Batch of fixes (4ian#8452)

* Profile not loading properly after log in / sign up
* Ai requests not loading properly if opened too quickly
* 3D Model previews not loading on desktop

* Fix the default value displayed for the related function of action with operator (4ian#8453)

* Add a callback after the in-game editor stepped (4ian#8457)

Only show in developer changelog

* Fix JS event API level target (4ian#8459)

* improve extensions list mode

* updates (#31)

* Batch of fixes (4ian#8452)

* Profile not loading properly after log in / sign up
* Ai requests not loading properly if opened too quickly
* 3D Model previews not loading on desktop

* Fix the default value displayed for the related function of action with operator (4ian#8453)

* Add a callback after the in-game editor stepped (4ian#8457)

Only show in developer changelog

* Fix JS event API level target (4ian#8459)

---------

Co-authored-by: Clément Pasteau <4895034+ClementPasteau@users.noreply.github.com>
Co-authored-by: D8H <Davy.Helard@gmail.com>

* Show did it work buttons more often for AI output (4ian#8456)

Do not show in changelog

* [Auto PR] Update translations (4ian#8454)

* BehaviorDialog, grid mode view and list mode improvment  and new catagory folder

* remove unused import

* Fix various issues and crashes when reloading/editing resoures in or outside the editor (4ian#8455)

* Bump newIDE version

* HomePage Menu Collapse

* Master official minor improvements (#38)

* Make the home page navigation sidebar collapsible

* ..

* Update HomePageMenuBar.js

* Enlarge collapsed home page navigation icons

* Remove flagging the game as mobile on every build (4ian#8465)

* Trigger unsaved changes when AI works, only when project actually modified (4ian#8464)

* Fix asset store pagination when navigating folders and correctly installing visible assets (4ian#8466)

* Fix rename context menu item not working anymore on the web-app (4ian#8468)

* Fix resources added on Windows using a backslash instead of a slash (not consistent with other platforms) (4ian#8467)

* Operators in instructions now automatically defaults to first value (4ian#8471)

* 000 (#40)

* Make the home page navigation sidebar collapsible

* Remove flagging the game as mobile on every build (4ian#8465)

* Trigger unsaved changes when AI works, only when project actually modified (4ian#8464)

* Fix asset store pagination when navigating folders and correctly installing visible assets (4ian#8466)

* Fix rename context menu item not working anymore on the web-app (4ian#8468)

* Fix resources added on Windows using a backslash instead of a slash (not consistent with other platforms) (4ian#8467)

* Operators in instructions now automatically defaults to first value (4ian#8471)

---------

Co-authored-by: Clément Pasteau <4895034+ClementPasteau@users.noreply.github.com>

* Fix tentatively crashes at scene editor resize

* Fix a crash when deleting a function folder while one of its function was selected (4ian#8475)

* Fix Spine objects not properly loading in the editor anymore (4ian#8476)

- Also fix hot reloading of Spine objects in preview and the 3D editor

* Bump newIDE version

* Fix potential UseAfterFreeError on VariablesContainer.serializeTo

* Introduce a direct link to open the create dialog (4ian#8460)

Don't show in changelog

* Allow extensions to set different icons for behaviors and objects (4ian#8472)

* Ensure JSON files end with a new line (4ian#8469)

Only show in developer changelog

* Fix some fields of the extension properties (4ian#8480)

* Bring forward the preview window on the web-app when hot-reloading (4ian#8478)

* Reduce extension search dialog to three columns

* Upgrade react-dnd to v14 and simplify drag-and-drop setup (4ian#8479)

Only show in developer changelog

* Fix potential use-after-free in instance properties when deleting scene instances (4ian#8481)

* Fix potential crash in instance properties (4ian#8483)

* Fix potential crash in the object properties (4ian#8484)

* Fix more potential crashes (4ian#8485)

* Bump newIDE version

* Add null safety checks for aiRequest.output property (4ian#8486)

Only show in developer changelog

---------

Co-authored-by: Clément Pasteau <4895034+ClementPasteau@users.noreply.github.com>
Co-authored-by: D8H <Davy.Helard@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Florian Rival <Florian.rival@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: LuniMoon <103995399+LuniMoon@users.noreply.github.com>
Co-authored-by: opaldi <2235599+opaldi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant