diff --git a/src/delegator.cpp b/src/delegator.cpp index 112ee248cdb9934e242237fe20eda6af67bca26c..142fea775c46ff5f3afb7ca29b3a631e9fbb4675 100644 --- a/src/delegator.cpp +++ b/src/delegator.cpp @@ -160,7 +160,8 @@ void Delegator::RegionStopLast(){ break; case NestingMode::Detection: case NestingMode::ProperlyNested: - const std::string& last_region_name = name_stack_.top(); + const std::string stack_empty="NESMIK: STACK EMPTPY"; + const std::string& last_region_name = name_stack_.empty() ? stack_empty: name_stack_.top(); pn_annotation_strategy_->RegionStopLast({last_region_name,name_stack_}); if(!name_stack_.empty()) {name_stack_.pop();} break;