From 9d1aff297265358c79025d8789b3736c50e919c4 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 28 Dec 2017 19:54:26 +0100 Subject: cleanup: Unchecked dynamic_cast CID 208309 Signed-off-by: Jan Mulder --- desktop-widgets/modeldelegates.cpp | 2 ++ 1 file changed, 2 insertions(+) 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(origIdx.model()); + if (!proxyModel) + return; QModelIndex index = proxyModel->mapToSource(origIdx); QStyledItemDelegate::initStyleOption(&opt, index); QString diveSiteName = index.data().toString(); -- cgit v1.2.3-70-g09d2