Bug 421076

Summary: Identical expressions in KoToolBase.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:12:06 UTC
```
if (d->canvas && d->canvas->canvasController() && d->canvas->canvasController()) {
```

https://invent.kde.org/kde/krita/-/blob/master/libs/flake/KoToolBase.cpp#L189
Comment 1 Tiar 2020-05-06 01:03:15 UTC
Git commit c2ffbc6b19ac966b231cc8edea13533ac56a310c by Agata Cacko.
Committed on 05/05/2020 at 22:48.
Pushed by tymond into branch 'master'.

Move asserts before usage of a variable

Before this commit, there were two asserts that were checked
only after both of the variables were used. This means that instead of
asserting, Krita would crash. It probaby doesn't change much in case of
Q_ASSERTs (it would be different with asserts that allows recovering)
but nonetheless, it makes no sense to assert after using a variable.
This commit moves the asserts above the usage.

M  +2    -2    libs/pigment/KoColorConversionSystem.cpp

https://invent.kde.org/kde/krita/commit/c2ffbc6b19ac966b231cc8edea13533ac56a310c