From 5b9a66758b031222366d8635161bc6c4ac5a39f5 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Mon, 24 Feb 2025 20:22:20 +0100 Subject: [PATCH] make sure that the 'selected' object is present. --- src/classes/PMusrCanvas.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 73a810f3..de7aa4bb 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -941,9 +941,10 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) // this is a workaround which should prevent that the key event is executed if // a text/latex is written into the canvas. - if (!strcmp(selected->GetTitle(), "dataTheoryPad")) - return; - + if (selected) { + if (!strcmp(selected->GetTitle(), "dataTheoryPad")) + return; + } if (fBatchMode) { if (fStartWithAvg) { // this is needed to get the averaging in the batch mode