diff --git a/graf2d/graf/src/TPolyLine.cxx b/graf2d/graf/src/TPolyLine.cxx
index 7f7676c1e45c57fb6ce545108cf31274c7895ae8..91254aa9ba62456f3a4fe51a6c94cbe1f11fef97 100644
--- a/graf2d/graf/src/TPolyLine.cxx
+++ b/graf2d/graf/src/TPolyLine.cxx
@@ -474,7 +474,7 @@ Int_t TPolyLine::Merge(TCollection *li)
    }
 
    //extend this polyline to hold npoints
-   if (pl) pl->SetPoint(npoints-1,0,0);
+   if (npoints > 1) SetPoint(npoints-1,0,0);
 
    //merge all polylines
    next.Reset();