projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent quasselclient from crashing when using the 'cancel' button of the 'Authorisat...
[quassel.git]
/
src
/
client
/
messagemodel.cpp
diff --git
a/src/client/messagemodel.cpp
b/src/client/messagemodel.cpp
index
ba5db09
..
d10a9bc
100644
(file)
--- a/
src/client/messagemodel.cpp
+++ b/
src/client/messagemodel.cpp
@@
-307,10
+307,12
@@
void MessageModel::customEvent(QEvent *event) {
}
void MessageModel::clear() {
}
void MessageModel::clear() {
- beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
- removeAllMessages();
- endRemoveRows();
_messagesWaiting.clear();
_messagesWaiting.clear();
+ if (rowCount() > 0) {
+ beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
+ removeAllMessages();
+ endRemoveRows();
+ }
}
// returns index of msg with given Id or of the next message after that (i.e., the index where we'd insert this msg)
}
// returns index of msg with given Id or of the next message after that (i.e., the index where we'd insert this msg)