ID 541285 - Clearing all layers from an Adjustment Stack, then adding a new layer, results in a crash

Follow

Problem summary
Clearing all layers from an Adjustment Stack, then adding a new layer, results in a crash.
 
Customer reported version
Mari 6.0v2
 
Customer reported platform
Windows 10
 
Steps to reproduce
 
1. Open Mari.
 
2. Open the example project (Help > Create Example Project).
 
3. Open the Layers palette.
 
4. Select the Diffuse layer, then click Add Adjustment Stack and select any option.
 
5. Click the Adjustment Stack icon on the Diffuse layer to open the Adjustment.
 

 
6. In the palette that appears, select the layer > right click > Remove Layers.
NOTE: The layer is not removed from the list, but the result should be updated in the View.
 
7. Click Add Adjustment Layer and select any option. Notice that Mari crashes.
 
Expected behaviour
Mari should not crash.
 
Actual behaviour
Clearing all layers from the Adjustment Stack, then adding a new layer, results in a crash.
 
Workaround
There are a couple of ways you can avoid this crash:
1. Hide the existing layer instead of deleting it, then add your new layer.
2. Add your new layer first, then delete the existing layer that you wish to remove.
 
Reproduced by support
This bug has been reproduced in:
Mari 6.0v2 - Windows 10 - Linux CentOS 7
Mari 6.0v1 - Windows 10
Mari 5.0v4 - Windows 10
Mari 5.0v3 - Windows 10 - Linux CentOS 7 - Regression
 
Unable to reproduce bug in:
Mari 5.0v2 - Windows 10 - Linux CentOS 7
 
Earliest version tested
Mari 5.0v2
- This issue doesn't appear in this version and has regressed
 

    We're sorry to hear that

    Please tell us why