From c622f463ada2240cfd4954d763c44f34b507389c Mon Sep 17 00:00:00 2001
From: TimQu <tim.quatmann@cs.rwth-aachen.de>
Date: Fri, 9 Nov 2018 16:36:14 +0100
Subject: [PATCH] JaniNextStateGenerator: Fixed an issue related to CTMCs
 without state-action rewards

---
 src/storm/generator/JaniNextStateGenerator.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/storm/generator/JaniNextStateGenerator.cpp b/src/storm/generator/JaniNextStateGenerator.cpp
index 0eaf8c480..f5d10d703 100644
--- a/src/storm/generator/JaniNextStateGenerator.cpp
+++ b/src/storm/generator/JaniNextStateGenerator.cpp
@@ -495,8 +495,10 @@ namespace storm {
                 
                 std::vector<ValueType> stateActionRewards(rewardExpressions.size(), storm::utility::zero<ValueType>());
                 for (auto const& choice : allChoices) {
-                    for (uint_fast64_t rewardVariableIndex = 0; rewardVariableIndex < rewardExpressions.size(); ++rewardVariableIndex) {
-                        stateActionRewards[rewardVariableIndex] += choice.getRewards()[rewardVariableIndex] * choice.getTotalMass() / totalExitRate;
+                    if (hasStateActionRewards) {
+                        for (uint_fast64_t rewardVariableIndex = 0; rewardVariableIndex < rewardExpressions.size(); ++rewardVariableIndex) {
+                            stateActionRewards[rewardVariableIndex] += choice.getRewards()[rewardVariableIndex] * choice.getTotalMass() / totalExitRate;
+                        }
                     }
                     
                     if (this->options.isBuildChoiceOriginsSet() && choice.hasOriginData()) {