From 26afd3b9b8e3073b94e2a4f5fffd3bb290835a9c Mon Sep 17 00:00:00 2001 From: Harmenszoon <25753539+Harmenszoon@users.noreply.github.com> Date: Mon, 11 May 2026 19:42:46 -0400 Subject: [PATCH] [Death Knight] guard lesser ghoul expressions --- engine/class_modules/sc_death_knight.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engine/class_modules/sc_death_knight.cpp b/engine/class_modules/sc_death_knight.cpp index a530c6e6b64..afb17937079 100644 --- a/engine/class_modules/sc_death_knight.cpp +++ b/engine/class_modules/sc_death_knight.cpp @@ -14147,19 +14147,20 @@ std::unique_ptr death_knight_t::create_expression( std::string_view name if ( util::str_compare_ci( splits[ 0 ], "lesser_ghoul" ) ) { - if ( util::str_compare_ci( splits[ 1 ], "count" ) ) + if ( splits.size() == 2 && util::str_compare_ci( splits[ 1 ], "count" ) ) { return make_fn_expr( "lesser_ghoul_count", [ this ]() { return active_lesser_ghouls.size(); } ); } - if ( util::str_compare_ci( splits[ 1 ], "oldest" ) ) + if ( splits.size() == 3 && util::str_compare_ci( splits[ 1 ], "oldest" ) ) { if ( util::str_compare_ci( splits[ 2 ], "remains" ) ) { - return make_fn_expr( "oldest_lesser_ghoul_remains", - [ this ]() { return active_lesser_ghouls[ 0 ]->expiration->remains(); } ); + return make_fn_expr( "oldest_lesser_ghoul_remains", [ this ]() { + return active_lesser_ghouls.empty() ? timespan_t::zero() : active_lesser_ghouls[ 0 ]->expiration->remains(); + } ); } } - throw sc_invalid_apl_argument( fmt::format( "Unknown lesser_ghoul expression '{}'.", splits[ 1 ] ) ); + throw sc_invalid_apl_argument( fmt::format( "Unknown lesser_ghoul expression '{}'.", name_str ) ); } if ( util::str_compare_ci( splits[ 0 ], "runeforge" ) && splits.size() == 2 )