Bug 421081

Summary: Toolbar is used before checking against nullptr in KisMainWindow.cpp
Product: [Applications] krita Reporter: Rafał Mikrut <mikrutrafal>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Rafał Mikrut 2020-05-05 20:36:58 UTC
```

        KToolBar * toolBar = ::qobject_cast<KToolBar *>(it);
        toolBar->setMovable(KisConfig(true).readEntry<bool>("LockAllDockerPanels", false));

        if (toolBar) {

```
https://invent.kde.org/kde/krita/-/blob/master/libs/ui/KisMainWindow.cpp#L514-517
Comment 1 Halla Rempt 2020-05-06 08:12:11 UTC
Git commit abac7729eed0abf50da65a01575c2f937c3cabc0 by Boudewijn Rempt.
Committed on 06/05/2020 at 08:07.
Pushed by rempt into branch 'krita/4.3'.

Check pointer before dereferencing

M  +1    -2    libs/ui/KisMainWindow.cpp

https://invent.kde.org/kde/krita/commit/abac7729eed0abf50da65a01575c2f937c3cabc0
Comment 2 Halla Rempt 2020-05-06 08:12:41 UTC
Git commit 79f44ba0da8c8e7048fe4b2a0afc79355fc4a131 by Boudewijn Rempt.
Committed on 06/05/2020 at 08:12.
Pushed by rempt into branch 'master'.

Check pointer before dereferencing
(cherry picked from commit abac7729eed0abf50da65a01575c2f937c3cabc0)

M  +1    -2    libs/ui/KisMainWindow.cpp

https://invent.kde.org/kde/krita/commit/79f44ba0da8c8e7048fe4b2a0afc79355fc4a131