Avoid NULL-pointer deref

Change-Id: I49115befb18c5342b96c5561882dcdfa45772f22
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
This commit is contained in:
Robert Loehning
2012-07-26 16:46:23 +02:00
committed by Jarek Kobus
parent 12a99d476c
commit 21cf52aeea

View File

@@ -286,9 +286,10 @@ void CodeStyleSelectorWidget::slotCopyClicked()
if (!ok) if (!ok)
return; return;
ICodeStylePreferences *copy = codeStylePool->cloneCodeStyle(currentPreferences); ICodeStylePreferences *copy = codeStylePool->cloneCodeStyle(currentPreferences);
copy->setDisplayName(newName); if (copy) {
if (copy) copy->setDisplayName(newName);
m_codeStyle->setCurrentDelegate(copy); m_codeStyle->setCurrentDelegate(copy);
}
} }
void CodeStyleSelectorWidget::slotEditClicked() void CodeStyleSelectorWidget::slotEditClicked()