You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Remove unnecessary code and add some error explanations
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user