Try-catch statements for Harmony patches

This commit is contained in:
SDraw 2022-09-13 08:09:33 +03:00
parent bee29e7771
commit 4e3d5dd6d4
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
6 changed files with 93 additions and 37 deletions

View file

@ -46,15 +46,29 @@ namespace ml_amt
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
void OnAvatarClear()
{
if(m_localTweaker != null)
m_localTweaker.OnAvatarClear();
try
{
if(m_localTweaker != null)
m_localTweaker.OnAvatarClear();
}
catch(System.Exception l_exception)
{
MelonLoader.MelonLogger.Error(l_exception);
}
}
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
void OnSetupAvatarGeneral()
{
if(m_localTweaker != null)
m_localTweaker.OnSetupAvatarGeneral();
try
{
if(m_localTweaker != null)
m_localTweaker.OnSetupAvatarGeneral();
}
catch(System.Exception l_exception)
{
MelonLoader.MelonLogger.Error(l_exception);
}
}
}
}