summaryrefslogtreecommitdiff
path: root/src/gui/models/colormodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/models/colormodel.cpp')
-rw-r--r--src/gui/models/colormodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/models/colormodel.cpp b/src/gui/models/colormodel.cpp
index 212ed5227..f7b18d300 100644
--- a/src/gui/models/colormodel.cpp
+++ b/src/gui/models/colormodel.cpp
@@ -70,6 +70,8 @@ void ColorModel::add(const std::string &name, const Color *const color1,
ColorModel *ColorModel::createDefault(const Widget2 *const widget)
{
ColorModel *const model = new ColorModel();
+ if (!widget)
+ return model;
// TRANSLATORS: color name
addColor(_("black"), BLACK);
// TRANSLATORS: color name