Add null check guards to unsubscriptions in `Dispose()`

This commit is contained in:
Bartłomiej Dach 2022-04-07 21:37:42 +02:00
parent 04db80848b
commit 71c0216c55
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 6 additions and 2 deletions

View File

@ -133,7 +133,9 @@ private void skinSourceChanged()
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
skin.SourceChanged -= skinSourceChanged;
if (skin != null)
skin.SourceChanged -= skinSourceChanged;
}
}
}

View File

@ -110,7 +110,9 @@ private void load(TextureStore textureStore, Storyboard storyboard)
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
skin.SourceChanged -= skinSourceChanged;
if (skin != null)
skin.SourceChanged -= skinSourceChanged;
}
}
}