diff --git a/demos/multislice.script b/demos/multislice.script
index 40fd08336e2718764dacb7f068ff5c7d3f3a4886..4a59ff0b5a76f271701320e85b1437e1a067f202 100644
--- a/demos/multislice.script
+++ b/demos/multislice.script
@@ -12,7 +12,7 @@ xmin = View[0].MinX; xmax = View[0].MaxX;
 ymin = View[0].MinY; ymax = View[0].MaxY;
 zmin = View[0].MinZ; zmax = View[0].MaxZ;
 
-If(xslices)
+If(xslices && xmin != xmax)
   For x In {xmin : xmax : (xmax-xmin) / (xslices > 1 ? (xslices-1) : 0.1)}
     If(!regular)
       Plugin(CutPlane).A = -1 ; Plugin(CutPlane).B = 0 ; Plugin(CutPlane).C = 0 ; 
@@ -27,7 +27,7 @@ If(xslices)
   EndFor
 EndIf
 
-If(yslices)
+If(yslices && ymin != ymax)
   For y In {ymin : ymax : (ymax-ymin) / (yslices > 1 ? (yslices-1) : 0.1)}
     If(!regular)
       Plugin(CutPlane).A = 0 ; Plugin(CutPlane).B = -1 ; Plugin(CutPlane).C = 0 ; 
@@ -42,7 +42,7 @@ If(yslices)
   EndFor
 EndIf
 
-If(zslices)
+If(zslices && zmin != zmax)
   For z In {zmin : zmax : (zmax-zmin) / (zslices > 1 ? (zslices-1) : 0.1)}
     If(!regular)
       Plugin(CutPlane).A = 0 ; Plugin(CutPlane).B = 0 ; Plugin(CutPlane).C = -1 ;