diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-03 08:37:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-03 08:37:24 +0100 |
commit | a24dd678fdef632300347df6e32b5b5b687b0e30 (patch) | |
tree | 1291a996363aeacfe73488d0fad8d1560e75014c | |
parent | 6322b0bbb7fec1e6574f0bb09c99647472ef3a52 (diff) | |
parent | 6c8ec5a930c56bb87c8c2db91e3fa38238b95bdd (diff) |
Merge pull request #15274 from GodotExplorer/debugger-fix-15238
Fix a bug for debugger
-rw-r--r-- | core/script_debugger_remote.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index a2505cbc53..a0a55ce86e 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -129,15 +129,21 @@ static ObjectID safe_get_instance_id(const Variant &p_v) { void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_variable) { packet_peer_stream->put_var(p_name); + + Variant var = p_variable; + if (p_variable.get_type() == Variant::OBJECT && !ObjectDB::instance_validate(p_variable)) { + var = Variant(); + } + int len = 0; - Error err = encode_variant(p_variable, NULL, len); + Error err = encode_variant(var, NULL, len); if (err != OK) ERR_PRINT("Failed to encode variant"); if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size packet_peer_stream->put_var(Variant()); } else { - packet_peer_stream->put_var(p_variable); + packet_peer_stream->put_var(var); } } |