summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-06-04 08:41:50 +0200
committerGitHub <noreply@github.com>2019-06-04 08:41:50 +0200
commitbdbf2e818c4bc40bdf57ed22d97ef6e3ee55c888 (patch)
treed81292bdff4589fe9d000fbdbe054bfb2ea2778f
parent909c3ad1a02b0e7da376b69431d05b5f2a163eaa (diff)
parent412a0b73e9291b10a89780014c66947a2588ea85 (diff)
Merge pull request #29461 from YeldhamDev/tilemapeditor_search_errorspam_fix
Fix error spam when typing in the TileMap editor's search box while having no results
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 4ef2d17128..7aa3d69bfa 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);
}