summaryrefslogtreecommitdiffstats
path: root/core/object.cpp
diff options
context:
space:
mode:
authoradmix <eugene.andreeshchev@gmail.com>2015-11-28 16:47:09 +0100
committeradmix <eugene.andreeshchev@gmail.com>2015-11-28 17:30:59 +0100
commitbc998c9195a63f1079884ac304620032f7d43367 (patch)
tree430473887ec7df73811ac9bf1e37346b42af72de /core/object.cpp
parente4c872a260320398cdf7ae0e920d53e46d5746a5 (diff)
downloadredot-engine-bc998c9195a63f1079884ac304620032f7d43367.tar.gz
fixed crash when creating new object with wrong number of arguments
Diffstat (limited to 'core/object.cpp')
-rw-r--r--core/object.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 07ac430d7a..3a4c06e7e7 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 {