diff --git a/include/plasp/pddl/expressions/NAry.h b/include/plasp/pddl/expressions/NAry.h index cdec036..e778f17 100644 --- a/include/plasp/pddl/expressions/NAry.h +++ b/include/plasp/pddl/expressions/NAry.h @@ -34,7 +34,7 @@ class NAry: public ExpressionCRTP private: void addArgument(const Expression *argument); void addArgument(ExpressionPointer &&argument); - + std::vector m_arguments; Expressions m_argumentStorage; }; @@ -83,6 +83,9 @@ std::unique_ptr NAry::parse(Context &context, template void NAry::addArgument(const Expression *argument) { + if (!argument) + return; + m_arguments.emplace_back(argument); } @@ -91,6 +94,9 @@ void NAry::addArgument(const Expression *argument) template void NAry::addArgument(ExpressionPointer &&argument) { + if (!argument) + return; + m_argumentStorage.emplace_back(std::move(argument)); m_arguments.emplace_back(m_argumentStorage.back().get()); }