Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
get rid of throw
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Jan 24, 2024
1 parent a72459a commit 2124aed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions RotationSolver.Basic/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ public static unsafe bool IsAlliance(this GameObject obj)
}
catch (Exception ex)
{
// Log or print the exception details for debugging
Svc.Log.Error($"Exception in {nameof(IsAlliance)}: {ex}");
throw; // Rethrow the exception to maintain the original exception flow
return false;
}
}

Expand Down
7 changes: 4 additions & 3 deletions RotationSolver.Basic/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,12 @@ private static IEnumerable<Status> GetAllStatus(this BattleChara obj, bool isFro
try
{
if (obj == null) return Array.Empty<Status>();
if (obj.StatusList == null) return Array.Empty<Status>();
if (obj.StatusList == null || obj.StatusList.Length == 0) return Array.Empty<Status>();

return obj.StatusList.Where(status => !isFromSelf
return obj?.StatusList?.Where(status => !isFromSelf
|| status.SourceId == Player.Object.ObjectId
|| status.SourceObject?.OwnerId == Player.Object.ObjectId);
|| status.SourceObject?.OwnerId == Player.Object.ObjectId)
?? Array.Empty<Status>();
}
catch (Exception ex)
{
Expand Down

0 comments on commit 2124aed

Please sign in to comment.