Skip to content

Commit c7da3b5

Browse files
committed
[gpad] avoid nullptr dereference
found out by clang-tidy
1 parent 122f0bb commit c7da3b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graf2d/gpad/src/TPad.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7025,7 +7025,7 @@ TObject *TPad::WaitPrimitive(const char *pname, const char *emode)
70257025
TObject *obj = nullptr;
70267026
Bool_t testlast = kFALSE;
70277027
Bool_t hasname = pname && (strlen(pname) > 0);
7028-
if (!pname[0] && !emode[0]) testlast = kTRUE;
7028+
if ((!pname || !pname[0]) && (!emode || !emode[0])) testlast = kTRUE;
70297029
if (testlast) gROOT->SetEditorMode();
70307030
while (!gSystem->ProcessEvents() && gROOT->GetSelectedPad() && gPad) {
70317031
if (gROOT->GetEditorMode() == 0) {

0 commit comments

Comments
 (0)