Skip to content

Commit 3114460

Browse files
committed
fix(archive_local_ads): ensure proper null checks for state properties
- Update the ArchiveLocalAdsState.copyWith constructor to properly handle null values for exception, restoredLocalAd, lastPendingDeletionId, and snackbarLocalAdTitle properties. - This change prevents potential null dereference errors when these properties are not explicitly provided when copying the state.
1 parent afc4300 commit 3114460

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/local_ads_management/bloc/archive_local_ads/archive_local_ads_state.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ class ArchiveLocalAdsState extends Equatable {
143143
videoAds: videoAds ?? this.videoAds,
144144
videoAdsCursor: videoAdsCursor ?? this.videoAdsCursor,
145145
videoAdsHasMore: videoAdsHasMore ?? this.videoAdsHasMore,
146-
exception: exception,
147-
restoredLocalAd: restoredLocalAd,
148-
lastPendingDeletionId: lastPendingDeletionId,
149-
snackbarLocalAdTitle: snackbarLocalAdTitle,
146+
exception: exception ?? this.exception,
147+
restoredLocalAd: restoredLocalAd ?? this.restoredLocalAd,
148+
lastPendingDeletionId: lastPendingDeletionId ?? this.lastPendingDeletionId,
149+
snackbarLocalAdTitle: snackbarLocalAdTitle ?? this.snackbarLocalAdTitle,
150150
);
151151
}
152152

0 commit comments

Comments
 (0)