fix: prevent crashing on release if property hook was not enabled

This commit is contained in:
Adamaq01 2023-05-14 00:24:26 +02:00
parent ca59382377
commit f1aab81c4f

View File

@ -113,8 +113,10 @@ pub fn hook_release() -> Result<()> {
return Ok(());
}
crochet::disable!(property_destroy_hook)
.map_err(|err| anyhow::anyhow!("Could not disable function detour: {:#}", err))?;
if crochet::is_enabled!(property_destroy_hook) {
crochet::disable!(property_destroy_hook)
.map_err(|err| anyhow::anyhow!("Could not disable function detour: {:#}", err))?;
}
Ok(())
}