make sure that the 'selected' object is present.

This commit is contained in:
suter_a 2025-02-24 20:22:20 +01:00
parent d65b04e855
commit 5b9a66758b

View File

@ -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