From 412a0b73e9291b10a89780014c66947a2588ea85 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Tue, 4 Jun 2019 01:44:38 -0300 Subject: [PATCH] Fix error spam when typing in the TileMap editor's search box while having no results --- editor/plugins/tile_map_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 4ef2d171280..7aa3d69bfac 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -503,7 +503,7 @@ void TileMapEditor::_update_palette() { if (selected.get(0) != TileMap::INVALID_CELL) { set_selected_tiles(selected); sel_tile = selected.get(Math::rand() % selected.size()); - } else { + } else if (palette->get_item_count() > 0) { palette->select(0); }