Remove unnecessary code and add some error explanations

This commit is contained in:
qarmin
2019-07-01 12:59:42 +02:00
parent eaaff9da31
commit 3c154eb93b
48 changed files with 149 additions and 187 deletions

View File

@ -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();
};