diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index 9319a1541..1ef3a0e82 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -478,7 +478,7 @@ namespace gtsam { } // if label is already in correct order, just put together a choice on label - if (!highestLabel || label > *highestLabel) { + if (!highestLabel || !nrChoices || label > *highestLabel) { boost::shared_ptr choiceOnLabel(new Choice(label, end - begin)); for (Iterator it = begin; it != end; it++) choiceOnLabel->push_back(it->root_);