Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 98f12880 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Check pointers before dereferencing

It shouldn't be possible, but bug 420626 shows that the settings
object can be zero under some circumstances.

BUG:420626
(cherry picked from commit 3ca93708da557b034b706340d2b5bf5b2e4c3be0)
parent 78d8377a
......@@ -314,17 +314,23 @@ KisSelectionSP KisResourcesSnapshot::activeSelection() const
bool KisResourcesSnapshot::needsAirbrushing() const
{
return m_d->currentPaintOpPreset->settings()->isAirbrushing();
return ( m_d->currentPaintOpPreset
&& m_d->currentPaintOpPreset->settings()
&& m_d->currentPaintOpPreset->settings()->isAirbrushing());
}
qreal KisResourcesSnapshot::airbrushingInterval() const
{
return m_d->currentPaintOpPreset->settings()->airbrushInterval();
return ( m_d->currentPaintOpPreset
&& m_d->currentPaintOpPreset->settings()
&& m_d->currentPaintOpPreset->settings()->airbrushInterval());
}
bool KisResourcesSnapshot::needsSpacingUpdates() const
{
return m_d->currentPaintOpPreset->settings()->useSpacingUpdates();
return ( m_d->currentPaintOpPreset
&& m_d->currentPaintOpPreset->settings()
&& m_d->currentPaintOpPreset->settings()->useSpacingUpdates());
}
void KisResourcesSnapshot::setOpacity(qreal opacity)
......
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