From 3d89a34adf8f99160af07f272c42daef2a28c9b4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 15 Sep 2018 20:03:15 +0300 Subject: [PATCH] Fix crash in theme editor. Fixes #5143. --- .../SourceFiles/window/themes/window_theme_editor_block.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp index dbd43e9a3..68231e8d5 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp @@ -310,7 +310,9 @@ void EditorBlock::activateRow(const Row &row) { bool EditorBlock::selectSkip(int direction) { _mouseSelection = false; - auto maxSelected = (isSearch() ? _searchResults.size() : _data.size()) - 1; + auto maxSelected = size_type(isSearch() + ? _searchResults.size() + : _data.size()) - 1; auto newSelected = _selected + direction; if (newSelected < -1 || newSelected > maxSelected) { newSelected = maxSelected;