diff --git a/CHANGELOG.md b/CHANGELOG.md index f934a4b..e4d1c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - The `kill()` method of unix PTY node can now be called without error as the underlying `pipe.close()` method of the gdnative library is now registered. - +- Fixed 'Condition "!obj" is true.' error that would often print to console when + closing terminals in the Terminal panel of the editor plugin. ## [v2.0.0](https://github.com/lihop/godot-xterm/compare/v1.2.1...v2.0.0) - 2021-07-25 diff --git a/addons/godot_xterm/native/src/node_pty/unix/pty.cc b/addons/godot_xterm/native/src/node_pty/unix/pty.cc index 560c78b..dd1b64c 100644 --- a/addons/godot_xterm/native/src/node_pty/unix/pty.cc +++ b/addons/godot_xterm/native/src/node_pty/unix/pty.cc @@ -445,8 +445,8 @@ static void pty_after_waitpid(uv_async_t *async) { Array argv = Array::make(baton->exit_code, baton->signal_code); - ERR_FAIL_COND(baton->cb == nullptr); - baton->cb->call_funcv(argv); + if (baton->cb != nullptr && baton->cb->is_valid()) + baton->cb->call_funcv(argv); uv_close((uv_handle_t *)async, pty_after_close); }