X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fabstractbuffercontainer.cpp;h=ad5a281524250f2283f970cd57ecaaed5187e453;hp=036731bab52faa9ee88cd3a0d5457828c954bdc5;hb=HEAD;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/uisupport/abstractbuffercontainer.cpp b/src/uisupport/abstractbuffercontainer.cpp index 036731ba..ad5a2815 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-2022 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;