X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fuisupport%2Fabstractbuffercontainer.cpp;h=922e2e9b387d8ea2619fcfd18237af7b2a80cfc6;hb=082cb8c8eb6db90cbb2166a0098874e76d5c6ad9;hp=036731bab52faa9ee88cd3a0d5457828c954bdc5;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;p=quassel.git diff --git a/src/uisupport/abstractbuffercontainer.cpp b/src/uisupport/abstractbuffercontainer.cpp index 036731ba..922e2e9b 100644 --- a/src/uisupport/abstractbuffercontainer.cpp +++ b/src/uisupport/abstractbuffercontainer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -46,8 +46,12 @@ void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex& parent, in } else { // check if there are explicitly buffers removed + // Make sure model is valid first + if (!parent.model()) { + return; + } for (int i = start; i <= end; i++) { - QVariant variant = parent.child(i, 0).data(NetworkModel::BufferIdRole); + QVariant variant = parent.model()->index(i, 0, parent).data(NetworkModel::BufferIdRole); if (!variant.isValid()) continue;