Check for drawObject != null before invoking draw object created event.

This commit is contained in:
Ottermandias 2023-09-02 15:54:11 +02:00
parent 0dbe9b59c2
commit b985833aaa

View file

@ -140,7 +140,7 @@ public unsafe class MetaState : IDisposable
{ {
_characterBaseCreateMetaChanges.Dispose(); _characterBaseCreateMetaChanges.Dispose();
_characterBaseCreateMetaChanges = DisposableContainer.Empty; _characterBaseCreateMetaChanges = DisposableContainer.Empty;
if (_lastCreatedCollection.Valid && _lastCreatedCollection.AssociatedGameObject != nint.Zero) if (_lastCreatedCollection.Valid && _lastCreatedCollection.AssociatedGameObject != nint.Zero && drawObject != nint.Zero)
_communicator.CreatedCharacterBase.Invoke(_lastCreatedCollection.AssociatedGameObject, _communicator.CreatedCharacterBase.Invoke(_lastCreatedCollection.AssociatedGameObject,
_lastCreatedCollection.ModCollection, drawObject); _lastCreatedCollection.ModCollection, drawObject);
_lastCreatedCollection = ResolveData.Invalid; _lastCreatedCollection = ResolveData.Invalid;