Salome HOME
Copyright update 2022
[modules/shaper.git] / src / FiltersPlugin / FiltersPlugin_OnPlaneSide.cpp
index 54f8c93918e219d94d18e583a697b238d3c59b75..6a5c458d8b65c7a2bad9049e39d1ce5a61c391ff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -27,7 +27,7 @@
 #include <GeomAPI_XYZ.h>
 
 
-bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType theType) const
+bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType /*theType*/) const
 {
   return true;
 }
@@ -42,8 +42,12 @@ bool FiltersPlugin_OnPlaneSide::isOk(const GeomShapePtr& theShape, const ResultP
   if (!aList.get())
     return false;
   GeomShapePtr aPlanarShape = aList->value();
-  if (!aPlanarShape)
-    aPlanarShape = aList->context()->shape();
+  if (!aPlanarShape) {
+    ResultPtr aContext = aList->context();
+    if (!aContext)
+      return false;
+    aPlanarShape = aContext->shape();
+  }
 
   GeomPlanePtr aPlane = aPlanarShape->face()->getPlane();
   GeomPointPtr aPlaneLoc = aPlane->location();