diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-07-01 12:59:42 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-07-01 12:59:42 +0200 |
commit | 3c154eb93b3a098354bf6d18a9428826ec193f90 (patch) | |
tree | d9c8c44f13883ceadaefc95953f9cb077137b7c8 /core/engine.cpp | |
parent | eaaff9da3178fa515a0f051fda932c1dd04d53db (diff) | |
download | redot-engine-3c154eb93b3a098354bf6d18a9428826ec193f90.tar.gz |
Remove unnecessary code and add some error explanations
Diffstat (limited to 'core/engine.cpp')
-rw-r--r-- | core/engine.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/engine.cpp b/core/engine.cpp index 50822244cf..2d8473fbd9 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -197,8 +197,10 @@ void Engine::add_singleton(const Singleton &p_singleton) { Object *Engine::get_singleton_object(const String &p_name) const { const Map<StringName, Object *>::Element *E = singleton_ptrs.find(p_name); - ERR_EXPLAIN("Failed to retrieve non-existent singleton '" + p_name + "'"); - ERR_FAIL_COND_V(!E, NULL); + if (!E) { + ERR_EXPLAIN("Failed to retrieve non-existent singleton '" + p_name + "'"); + ERR_FAIL_V(NULL); + } return E->get(); }; |