summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-03-06 11:08:33 (GMT)
committerTobias Markmann <tm@ayena.de>2017-03-06 11:08:33 (GMT)
commitfe92cc9dfbcde566ba2ac9af23e6774942c856cb (patch)
tree161db200f6beb02f92036f03e411c3aee6602891 /Swift
parent585e23d06c7754b4cdbf3cf0096fe5b4bba278d1 (diff)
downloadswift-fe92cc9dfbcde566ba2ac9af23e6774942c856cb.zip
swift-fe92cc9dfbcde566ba2ac9af23e6774942c856cb.tar.bz2
Fix emoji dialog crash when there are no recent emojis
The dialog would crash if the user has not selected an emoji ever before through the dialog. Test-Information: Cleared recent list and opened the dialog. Without this patch it would crash, since there are no items in the emojiLayout. Now it does not crash anymore, on macOS 10.12.3 with Qt 5.5.1. Change-Id: Ie736b5af7fe8b2b2c14fcac94b7e4f3bc13f4b84
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtEmojisScroll.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/QtEmojisScroll.cpp b/Swift/QtUI/QtEmojisScroll.cpp
index 27963a1..2c347bb 100644
--- a/Swift/QtUI/QtEmojisScroll.cpp
+++ b/Swift/QtUI/QtEmojisScroll.cpp
@@ -24,6 +24,9 @@ namespace Swift {
this->setLayout(new QVBoxLayout);
this->layout()->addWidget(scrollArea);
this->layout()->setContentsMargins(0,0,0,0);
- setMinimumHeight(emojiLayout->itemAt(0)->minimumSize().height() * 8);
+
+ if (emojiLayout->itemAt(0)) {
+ setMinimumHeight(emojiLayout->itemAt(0)->minimumSize().height() * 8);
+ }
}
}