summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-12-28 19:54:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-29 09:14:20 -0800
commit9d1aff297265358c79025d8789b3736c50e919c4 (patch)
tree40a3ec6e6deccee48b7ef834c4e6149b2a9b30c9
parent0852f9a2ab939dd97ca8d5644ad505b405e6464d (diff)
downloadsubsurface-9d1aff297265358c79025d8789b3736c50e919c4.tar.gz
cleanup: Unchecked dynamic_cast
CID 208309 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
-rw-r--r--desktop-widgets/modeldelegates.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp
index 9ffbe605b..bdeaf9138 100644
--- a/desktop-widgets/modeldelegates.cpp
+++ b/desktop-widgets/modeldelegates.cpp
@@ -451,6 +451,8 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
QFontMetrics fmBigger(fontBigger);
QStyleOptionViewItem opt = option;
const QAbstractProxyModel *proxyModel = dynamic_cast<const QAbstractProxyModel*>(origIdx.model());
+ if (!proxyModel)
+ return;
QModelIndex index = proxyModel->mapToSource(origIdx);
QStyledItemDelegate::initStyleOption(&opt, index);
QString diveSiteName = index.data().toString();