From 6b3c4964f830e32bbd6baf349494075aa4df2d84 Mon Sep 17 00:00:00 2001 From: Ethan Blackwood Date: Mon, 10 Dec 2018 16:18:46 -0600 Subject: [PATCH] Fix crash when clicking on canvas with no channels --- Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp index b9b5eb273..6b7c19e21 100644 --- a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp +++ b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp @@ -3033,6 +3033,11 @@ bool LfpDisplay::getSingleChannelState() void LfpDisplay::mouseDown(const MouseEvent& event) { + if (drawableChannels.isEmpty()) + { + return; + } + //int y = event.getMouseDownY(); //relative to each channel pos MouseEvent canvasevent = event.getEventRelativeTo(viewport); int y = canvasevent.getMouseDownY() + viewport->getViewPositionY(); // need to account for scrolling