Ark2000 / PankuConsole

Feature-packed real-time debugging toolkit for Godot Engine.
https://k2kra.xyz/PankuConsole/
MIT License
997 stars 38 forks source link

Data Controller causes a crash when switching scenes. #132

Closed thiscris closed 11 months ago

thiscris commented 12 months ago

Describe the bug When an object in a scene is freed (due to scene change) the attached Data Controller causes a crash.

Error Attempt to call function 'get' in base 'previously freed' on a null instance. Stack Trace 0 res://addons/panku_console/modules/data_controller/exporter/exporter_2.gd :122 Code line row.update_ui(obj.get(prop_name))

To Reproduce Steps to reproduce the behavior:

  1. Create a project with 2 scenes
  2. Run one of the scenes
  3. Open Panku console and open a data controller for a node in the scene current.get_node("MyNode")
  4. Go to a different scene
  5. See error (Godot Debugger)

Expected behavior Data Controller changes output to a notification such as "Missing node" , without interrupting the flow.

Additional context A simple check for the existence of obj in the update_rows() function will prevent the crash. I am very new to PankuConsole, maybe I am using it incorrectly?

Ark2000 commented 12 months ago

Add is_instance_valid() check, I hope it works now.

Ark2000 commented 12 months ago

@thiscris is it fixed now?