@@ -336,6 +336,19 @@ private static IEnumerable<byte> StatusStacks(this IBattleChara battleChara, boo
336
336
/// <returns></returns>
337
337
public static bool HasStatus ( this IBattleChara battleChara , bool isFromSelf , params StatusID [ ] statusIDs )
338
338
{
339
+ try
340
+ {
341
+ if ( battleChara . StatusList == null )
342
+ {
343
+ return false ;
344
+ }
345
+ }
346
+ catch
347
+ {
348
+ // StatusList threw, treat as unavailable
349
+ return false ;
350
+ }
351
+
339
352
if ( HasApplyStatus ( battleChara , statusIDs ) )
340
353
{
341
354
return true ;
@@ -417,9 +430,27 @@ internal static string GetStatusName(StatusID id)
417
430
/// <param name="isFromSelf">Whether the statuses are from self.</param>
418
431
/// <param name="statusIDs">The status IDs to look for.</param>
419
432
/// <returns>An enumerable of statuses.</returns>
420
- private static IEnumerable < Status > GetStatus ( this IBattleChara battleChara , bool isFromSelf , params StatusID [ ] statusIDs )
433
+ private static List < Status > GetStatus ( this IBattleChara battleChara , bool isFromSelf , params StatusID [ ] statusIDs )
421
434
{
422
- IEnumerable < Status > allStatuses = battleChara . GetAllStatus ( isFromSelf ) ;
435
+ if ( battleChara == null )
436
+ {
437
+ return [ ] ;
438
+ }
439
+
440
+ try
441
+ {
442
+ if ( battleChara . StatusList == null )
443
+ {
444
+ return [ ] ;
445
+ }
446
+ }
447
+ catch
448
+ {
449
+ // StatusList threw, treat as unavailable
450
+ return [ ] ;
451
+ }
452
+
453
+ List < Status > allStatuses = battleChara . GetAllStatus ( isFromSelf ) ;
423
454
if ( allStatuses == null )
424
455
{
425
456
return [ ] ;
@@ -458,13 +489,26 @@ private static IEnumerable<Status> GetStatus(this IBattleChara battleChara, bool
458
489
/// <param name="battleChara">The object to get the statuses from.</param>
459
490
/// <param name="isFromSelf">Whether the statuses are from self.</param>
460
491
/// <returns>An enumerable of all statuses.</returns>
461
- private static IEnumerable < Status > GetAllStatus ( this IBattleChara battleChara , bool isFromSelf )
492
+ private static List < Status > GetAllStatus ( this IBattleChara battleChara , bool isFromSelf )
462
493
{
463
494
if ( battleChara == null )
464
495
{
465
496
return [ ] ;
466
497
}
467
498
499
+ try
500
+ {
501
+ if ( battleChara . StatusList == null )
502
+ {
503
+ return [ ] ;
504
+ }
505
+ }
506
+ catch
507
+ {
508
+ // StatusList threw, treat as unavailable
509
+ return [ ] ;
510
+ }
511
+
468
512
ulong playerId = Player . Object . GameObjectId ;
469
513
List < Status > result = [ ] ;
470
514
0 commit comments