diff --git a/src/graph-optimizer.cc b/src/graph-optimizer.cc
index 045615bc9cc99373aaed5bfbc1af671d5b6a1039..e07bc79be0656ca498827e034fb78645af556760 100644
--- a/src/graph-optimizer.cc
+++ b/src/graph-optimizer.cc
@@ -84,8 +84,10 @@ PathVectorPtr_t GraphOptimizer::optimize(const PathVectorPtr_t& path) {
       p->pathProjector(problem()->pathProjector());
       p->steeringMethod(edge->steeringMethod()->copy());
       p->constraints(p->steeringMethod()->constraints());
-      p->constraints()->configProjector()->rightHandSideFromConfig(
-          toOpt->initial());
+      if (p->constraints() && p->constraints()->configProjector()){
+        p->constraints()->configProjector()->rightHandSideFromConfig(
+            toOpt->initial());
+      }
       p->pathValidation(edge->pathValidation());
       pathOptimizer_ = factory_(p);
       toConcat = pathOptimizer_->optimize(toOpt);