Skip to content

Commit a2ea84d

Browse files
committed
Fix crash when opening LFP Viewer Beta drawer without canvas
1 parent 2713811 commit a2ea84d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Source/Plugins/LfpDisplayNodeBeta/LfpDisplayCanvas.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,9 @@ void LfpDisplay::paint(Graphics& g)
18081808

18091809
void LfpDisplay::refresh()
18101810
{
1811+
// Ensure the lfpChannelBitmap has been initialized
1812+
if (lfpChannelBitmap.isNull()) { resized(); }
1813+
18111814
// X-bounds of this update
18121815
int fillfrom = canvas->lastScreenBufferIndex[0];
18131816
int fillto = (canvas->screenBufferIndex[0]);

Source/Processors/Editors/VisualizerEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void VisualizerEditor::buttonClicked (Button* button)
201201
GenericEditor::buttonClicked (button);
202202

203203
// Handle the buttons to open the canvas in a tab or window
204-
if (canvas == nullptr)
204+
if ((button == windowSelector || button == tabSelector) && canvas == nullptr)
205205
{
206206
canvas = createNewCanvas();
207207
canvas->update();

0 commit comments

Comments
 (0)