summaryrefslogtreecommitdiff
path: root/core/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/engine.cpp')
-rw-r--r--core/engine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/engine.cpp b/core/engine.cpp
index 9607dedb3c..2d8473fbd9 100644
--- a/core/engine.cpp
+++ b/core/engine.cpp
@@ -38,6 +38,7 @@
void Engine::set_iterations_per_second(int p_ips) {
+ ERR_FAIL_COND(p_ips <= 0);
ips = p_ips;
}
int Engine::get_iterations_per_second() const {
@@ -196,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();
};