Added missing null check reported in #817.
diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 2c5a5e9..defd6b7 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -4847,6 +4847,11 @@
   for (p=primitive_info; p->primitive != UndefinedPrimitive; p+=p->coordinates)
   {
     stroke_polygon=TraceStrokePolygon(draw_info,p);
+    if (stroke_polygon == (PrimitiveInfo *) NULL)
+      {
+        status=0;
+        break;
+      }
     status&=DrawPolygonPrimitive(image,clone_info,stroke_polygon,exception);
     if (status == 0)
       break;