Fix crash on opening project with 1D and 2D data (#1042)

The problem is presumably that on the first appearance the loaded 2D data become the context of color map and stay connected with it.

In case of switching to another 2D data the new context was set.

But on switching to 1D data the 2D context of color map was not set to nullptr, just widget was hidded.

And when the hidden 2D plot emitted some signals (for internal reasons?), the mismatch between the current data (1D) and the context of the color map (2D) lead to crash.

Probably in certain situations we could get the problem while switching from 2D to 1D, but it wasn't observed yet.

Here I just added couple of nullptr checks in slots. Symptomatic solution.

Resolves #1042 (closed)

Edited by Mikhail Svechnikov

Merge request reports

Loading