diff --git a/lib/src/message/src/message_extras.dart b/lib/src/message/src/message_extras.dart index b52f6e624..59c139047 100644 --- a/lib/src/message/src/message_extras.dart +++ b/lib/src/message/src/message_extras.dart @@ -32,11 +32,14 @@ class MessageExtras with ObjectHash { // for example, when it's a CastMap, so we need to create a mutable // instance from the existing extras map final mutableExtrasMap = Map.from(extrasMap); - final deltaMap = - mutableExtrasMap.remove(TxMessageExtras.delta) as Map?; + final deltaMap = mutableExtrasMap.remove(TxMessageExtras.delta) as Map?; + final deltaExtras = (deltaMap == null) + ? null + : DeltaExtras.fromMap(Map.from(deltaMap)); + return MessageExtras._withDelta( mutableExtrasMap, - (deltaMap == null) ? null : DeltaExtras.fromMap(deltaMap), + deltaExtras, ); }