Get rid of gridmap error due to not yet valid cursor instance, fixes #17546

This commit is contained in:
Juan Linietsky 2018-11-16 09:10:44 -03:00
parent 0b1e93ccd4
commit 8306d60e85

View file

@ -802,7 +802,9 @@ void GridMapEditor::edit(GridMap *p_gridmap) {
VisualServer::get_singleton()->instance_set_visible(grid_instance[i], false);
}
VisualServer::get_singleton()->instance_set_visible(cursor_instance, false);
if (cursor_instance.is_valid()) {
VisualServer::get_singleton()->instance_set_visible(cursor_instance, false);
}
return;
}