diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-10-26 15:18:38 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-10-26 15:36:58 (GMT) |
commit | 1320df7e64a1d91d3da912575c823df532c7390c (patch) | |
tree | b99dbf71b51fcb0bb7e4ddde0164991391825fcb /Swift/QtUI | |
parent | 22501a3af25840b90898c3b4c075581947646476 (diff) | |
download | swift-contrib-1320df7e64a1d91d3da912575c823df532c7390c.zip swift-contrib-1320df7e64a1d91d3da912575c823df532c7390c.tar.bz2 |
Don't crash when clicking a Windows popup without a registered action.
Resolves: #1021
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/WindowsNotifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Swift/QtUI/WindowsNotifier.cpp b/Swift/QtUI/WindowsNotifier.cpp index 49489a3..1789451 100644 --- a/Swift/QtUI/WindowsNotifier.cpp +++ b/Swift/QtUI/WindowsNotifier.cpp @@ -36,13 +36,15 @@ void WindowsNotifier::showMessage(Type type, const std::string& subject, const s if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) { return; } lastCallback = callback; int timeout = (type == IncomingMessage || type == SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS; tray->showMessage(P2QSTRING(subject), P2QSTRING(description), type == SystemMessage ? QSystemTrayIcon::Information : QSystemTrayIcon::NoIcon, timeout * 1000); } void WindowsNotifier::handleMessageClicked() { - lastCallback(); + if (lastCallback) { + lastCallback(); + } } } |