summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Feck <cfeck@kde.org>2016-11-02 03:45:56 (GMT)
committerChristoph Feck <cfeck@kde.org>2016-11-02 03:45:56 (GMT)
commita4c2986d2c8dbcac43cc7a8b49a3b03203372376 (patch)
treee4442414f87f3a3b782c61ff703521363be780c4
parent1f35c6d3dffbdfbbd7679e6b9a6297bd421abb3e (diff)
Fix crash if mimeData is nullv16.11.80
BUG: 371852
-rw-r--r--kcolorchooser.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/kcolorchooser.cpp b/kcolorchooser.cpp
index 8b1f7c1..408aab1 100644
--- a/kcolorchooser.cpp
+++ b/kcolorchooser.cpp
@@ -90,9 +90,11 @@ int main(int argc, char *argv[])
dlg.setCurrentColor(QColor(parser.value(color)));
} else {
const QMimeData* mimeData = QApplication::clipboard()->mimeData(QClipboard::Clipboard);
- QColor clipboardColor = mimeData->colorData().value<QColor>();
- if (clipboardColor.isValid()) {
- dlg.setCurrentColor(clipboardColor);
+ if (mimeData) {
+ QColor clipboardColor = mimeData->colorData().value<QColor>();
+ if (clipboardColor.isValid()) {
+ dlg.setCurrentColor(clipboardColor);
+ }
}
}