From 63601e0b8a39b06ba0ecd7e5e0170db36164014a Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 22 Apr 2014 14:14:06 +0200 Subject: [PATCH] Calling getExpression on an undefined constant is now properly treated with an exception. Former-commit-id: 2d3e06a20af6d7170db29cd046668951e2c3567d --- src/storage/prism/Constant.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/storage/prism/Constant.cpp b/src/storage/prism/Constant.cpp index 3df0a26bc..641336c76 100644 --- a/src/storage/prism/Constant.cpp +++ b/src/storage/prism/Constant.cpp @@ -1,4 +1,6 @@ #include "src/storage/prism/Constant.h" +#include "src/exceptions/ExceptionMacros.h" +#include "src/exceptions/IllegalFunctionCallException.h" namespace storm { namespace prism { @@ -23,6 +25,7 @@ namespace storm { } storm::expressions::Expression const& Constant::getExpression() const { + LOG_THROW(this->isDefined(), storm::exceptions::IllegalFunctionCallException, "Unable to retrieve defining expression for undefined constant."); return this->expression; }