Skip structure detection on preprocessor failure
Change-Id: I679ff2045ab0ac5da64e72d87e0c78054369da5c
diff --git a/internal/ceres/solver.cc b/internal/ceres/solver.cc
index b72661c..611e465 100644
--- a/internal/ceres/solver.cc
+++ b/internal/ceres/solver.cc
@@ -773,7 +773,7 @@
// modified_options.linear_solver_type because, depending on the
// lack of a Schur structure, the preprocessor may change the linear
// solver type.
- if (IsSchurType(pp.linear_solver_options.type)) {
+ if (status && IsSchurType(pp.linear_solver_options.type)) {
// TODO(sameeragarwal): We can likely eliminate the duplicate call
// to DetectStructure here and inside the linear solver, by
// calling this in the preprocessor.