]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix crash when device with capacitybar is dragged
authorChris Holland <zrenfire@gmail.com>
Fri, 18 Dec 2020 00:10:40 +0000 (19:10 -0500)
committerChris Holland <zrenfire@gmail.com>
Fri, 18 Dec 2020 00:10:40 +0000 (19:10 -0500)
BUG: 430441

src/panels/places/placesitemlistwidget.cpp

index c9de3e6cf571e59527237985896e0695c80c07ea..2d5111c56c5d0394ad31548c39d914994f018397 100644 (file)
@@ -106,7 +106,8 @@ void PlacesItemListWidget::paint(QPainter* painter, const QStyleOptionGraphicsIt
 {
     KStandardItemListWidget::paint(painter, option, widget);
 
-    if (m_drawCapacityBar) {
+    // We check if option=nullptr since it is null when the place is dragged (Bug #430441)
+    if (m_drawCapacityBar && option) {
         const TextInfo* textInfo = m_textInfo.value("text");
         if (textInfo) { // See KStandarItemListWidget::paint() for info on why we check textInfo.
             painter->save();