Adding AccessViolationException catch to return true for NullDrawObject
This commit is contained in:
@@ -123,7 +123,8 @@ public class PlayerDataFactory
|
|||||||
{
|
{
|
||||||
if (playerPointer == IntPtr.Zero)
|
if (playerPointer == IntPtr.Zero)
|
||||||
return true;
|
return true;
|
||||||
|
try
|
||||||
|
{
|
||||||
var character = (Character*)playerPointer;
|
var character = (Character*)playerPointer;
|
||||||
if (character == null)
|
if (character == null)
|
||||||
return true;
|
return true;
|
||||||
@@ -134,6 +135,11 @@ public class PlayerDataFactory
|
|||||||
|
|
||||||
return gameObject->DrawObject == null;
|
return gameObject->DrawObject == null;
|
||||||
}
|
}
|
||||||
|
catch (AccessViolationException)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static bool IsCacheFresh(CacheEntry entry)
|
private static bool IsCacheFresh(CacheEntry entry)
|
||||||
=> (DateTime.UtcNow - entry.CreatedUtc) <= _characterCacheTtl;
|
=> (DateTime.UtcNow - entry.CreatedUtc) <= _characterCacheTtl;
|
||||||
|
|||||||
Reference in New Issue
Block a user