Added null check on GetCid if it is empty, would return zero

This commit is contained in:
cake
2025-12-22 03:36:06 +01:00
parent be068ed6d1
commit cc011743af

View File

@@ -490,6 +490,10 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
{
EnsureIsOnFramework();
var playerChar = GetPlayerCharacter();
if (playerChar == null || playerChar.Address == IntPtr.Zero)
return 0;
return ((BattleChara*)playerChar.Address)->Character.ContentId;
}