Browse Source

Fix crash when using `Node.get_as_property_path()`

This closes #32679.
Hugo Locurcio 5 years ago
parent
commit
0528ce0a2a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/node_path.cpp

+ 1 - 1
core/node_path.cpp

@@ -269,7 +269,7 @@ NodePath NodePath::rel_path_to(const NodePath &p_np) const {
 
 
 NodePath NodePath::get_as_property_path() const {
 NodePath NodePath::get_as_property_path() const {
 
 
-	if (!data->path.size()) {
+	if (!data || !data->path.size()) {
 		return *this;
 		return *this;
 	} else {
 	} else {
 		Vector<StringName> new_path = data->subpath;
 		Vector<StringName> new_path = data->subpath;