summaryrefslogtreecommitdiff
path: root/editor/rename_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/rename_dialog.cpp')
-rw-r--r--editor/rename_dialog.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
index 858b14a733..40343cf908 100644
--- a/editor/rename_dialog.cpp
+++ b/editor/rename_dialog.cpp
@@ -475,17 +475,17 @@ String RenameDialog::_substitute(const String &subject, const Node *node, int co
if (root_node) {
result = result.replace("${ROOT}", root_node->get_name());
}
-
- Node *parent_node = node->get_parent();
- if (parent_node) {
- if (node == root_node) {
- // Can not substitute parent of root.
- result = result.replace("${PARENT}", "");
- } else {
- result = result.replace("${PARENT}", parent_node->get_name());
+ if (node) {
+ Node *parent_node = node->get_parent();
+ if (parent_node) {
+ if (node == root_node) {
+ // Can not substitute parent of root.
+ result = result.replace("${PARENT}", "");
+ } else {
+ result = result.replace("${PARENT}", parent_node->get_name());
+ }
}
}
-
return result;
}