From bc998c9195a63f1079884ac304620032f7d43367 Mon Sep 17 00:00:00 2001 From: admix Date: Sat, 28 Nov 2015 16:47:09 +0100 Subject: [PATCH] fixed crash when creating new object with wrong number of arguments --- core/object.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/object.cpp b/core/object.cpp index 07ac430d7ab..3a4c06e7e7b 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -970,7 +970,10 @@ void Object::set_script_instance(ScriptInstance *p_instance) { script_instance=p_instance; - script=p_instance->get_script().get_ref_ptr(); + if (p_instance) + script=p_instance->get_script().get_ref_ptr(); + else + script=RefPtr(); } RefPtr Object::get_script() const {