Commit db846dad authored by Boudewijn Rempt's avatar Boudewijn Rempt

CID 248716: Explicit null dereferenced (FORWARD_NULL)

5. var_deref_model: Passing null pointer profile to setName, which
dereferences it.
parent eeee0ea1
......@@ -146,13 +146,18 @@ bool KisInputProfileManager::renameProfile(const QString &oldName, const QString
}
KisInputProfile *profile = d->profiles.value(oldName);
d->profiles.remove(oldName);
profile->setName(newName);
d->profiles.insert(newName, profile);
if (profile) {
d->profiles.remove(oldName);
profile->setName(newName);
d->profiles.insert(newName, profile);
emit profilesChanged();
emit profilesChanged();
return true;
}
return true;
return false;
}
void KisInputProfileManager::duplicateProfile(const QString &name, const QString &newName)
......
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