Commit 56bf0036 authored by Boudewijn Rempt's avatar Boudewijn Rempt

CID 248947: Explicit null dereferenced (FORWARD_NULL)

38. var_deref_model: Passing null pointer assistant to setUseCustomColor,
which dereferences it.
parent db846dad
......@@ -789,23 +789,24 @@ void KisAssistantTool::loadAssistants()
errors = true;
}
if (assistant) {
// load custom shared assistant properties
if (xml.attributes().hasAttribute("useCustomColor")) {
QStringRef useCustomColor = xml.attributes().value("useCustomColor");
// load custom shared assistant properties
if ( xml.attributes().hasAttribute("useCustomColor")) {
QStringRef useCustomColor = xml.attributes().value("useCustomColor");
bool usingColor = false;
if (useCustomColor.toString() == "1") {
usingColor = true;
}
assistant->setUseCustomColor(usingColor);
}
bool usingColor = false;
if (useCustomColor.toString() == "1") {
usingColor = true;
}
assistant->setUseCustomColor(usingColor);
}
if ( xml.attributes().hasAttribute("useCustomColor")) {
QStringRef customColor = xml.attributes().value("customColor");
assistant->setAssistantCustomColor( KisDomUtils::qStringToQColor(customColor.toString()) );
if ( xml.attributes().hasAttribute("useCustomColor")) {
QStringRef customColor = xml.attributes().value("customColor");
assistant->setAssistantCustomColor( KisDomUtils::qStringToQColor(customColor.toString()) );
}
}
}
}
if (assistant) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment