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

Commit

Permalink
fix for crash on login when on jobs that check statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Feb 22, 2024
1 parent 392d639 commit 8d485ba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
17 changes: 2 additions & 15 deletions RotationSolver.Basic/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,8 @@ private static IEnumerable<Status> GetStatus(this BattleChara obj, bool isFromSe

private static IEnumerable<Status> GetAllStatus(this BattleChara obj, bool isFromSelf)
{
try
{
if (obj == null) return Array.Empty<Status>();
if (obj.StatusList == null || obj.StatusList.Length == 0) return Array.Empty<Status>();

return obj?.StatusList?.Where(status => !isFromSelf
|| status.SourceId == Player.Object.ObjectId
|| status.SourceObject?.OwnerId == Player.Object.ObjectId)
?? Array.Empty<Status>();
}
catch (Exception ex)
{
Svc.Log.Error($"Failed to {nameof(GetAllStatus)}", ex);
return Array.Empty<Status>();
}
if (obj is not BattleChara b) return [];
return b.StatusList.Where(status => !isFromSelf || status.SourceId == Player.Object.ObjectId || status.SourceObject?.OwnerId == Player.Object.ObjectId);
}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/RotationSolver.Basic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UseWindowsForms>true</UseWindowsForms>
<Platforms>x64</Platforms>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/RotationSolver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UseWindowsForms>true</UseWindowsForms>
<Platforms>x64</Platforms>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugType>full</DebugType>
Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 8d485ba

Please sign in to comment.