Browse Source

Merge pull request #2937 from koalefant/master

fixed crash when creating new object with wrong number of arguments (rebased)
Rémi Verschelde 9 năm trước cách đây
mục cha
commit
280d72eb8b
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      core/object.cpp

+ 4 - 1
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 {