Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Dialogic panel has not been opened, current_editor is null, causing error on save and Debug Game start: "editors_manager.gd:212 - Invalid call. Nonexistent function '_save' in base 'Nil'." #2250

Closed
hsandt opened this issue May 22, 2024 · 0 comments · Fixed by #2253
Labels
Bug 🐞 Something isn't working

Comments

@hsandt
Copy link

hsandt commented May 22, 2024

The problem

Describe the bug

On save and Debug Game start, I see this output error flashing:

res://addons/dialogic/Editor/editors_manager.gd:212 - Invalid call. Nonexistent function '_save' in base 'Nil'.

since it happens just before actual game start, when output log is configured to be Cleared on start (Editor Settings > run/output/always_clear_output_on_play), it disappears quickly, but you can disable auto-clear to see it better.

Then errors will appear just before --- Debugging process started ---

I found the line causing the error:

## Called by the plugin.gd script on CTRL+S or Debug Game start
func save_current_resource() -> void:
	current_editor._save()

so it's normal that it's run on save and Debug Game start, but for some reason the current editor is null.

It seems to happen after opening Godot and not opening the Dialogic panel at all, but I didn't notice it before although I haven't always been working with Dialogic, so I'm not sure.

After opening Dialogic panel just clicking on the Dialogic top button, error still occurs until you actual select a tab (e.g. Styles). From there, error will not occur.

To Reproduce
Steps to reproduce the behavior:

  1. Start Godot project with Dialogic, but don't open the Dialogic panel
  2. Save and/or Debug Game start
  3. Disable Editor Settings > run/output/always_clear_output_on_play
  4. See output log errors

Expected behavior
There should be no errors.

System (please complete the following information):

  • OS: Linux Ubuntu 22.04
  • Godot Version: v4.2.1.stable.official [b09f793f5]
  • Dialogic Version: main branch, commit 2858c4e (2024-05-15)

Solutions

Workaround

Open the Dialogic panel and select one tab

Possible fixes

Check if current_editor != null before using it everywhere

@Jowan-Spooner Jowan-Spooner added the Bug 🐞 Something isn't working label May 23, 2024
Jowan-Spooner added a commit to Jowan-Spooner/dialogic that referenced this issue May 23, 2024
Jowan-Spooner added a commit that referenced this issue May 25, 2024
* Prevent autoload from constantly changing position in list

* Fix #2250

* Fix #2248

* Small static typing fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants