diff --git a/lib/framework/object_list_iteration.h b/lib/framework/object_list_iteration.h index d92bdf000c2..f4dd377b851 100644 --- a/lib/framework/object_list_iteration.h +++ b/lib/framework/object_list_iteration.h @@ -100,6 +100,11 @@ void mutating_list_iterate(std::list& list, MaybeErasingLoopBodyHan "Unsupported loop body handler signature: " "should return IterationResult and take either an ObjectType* or an iterator"); + if (list.empty()) + { + return; + } + typename std::remove_reference_t::iterator it = list.begin(), itNext; while (it != list.end()) {