Skip to content

Commit

Permalink
fix: attempt 2 of fixing null exception when telephonyInfo is null
Browse files Browse the repository at this point in the history
  • Loading branch information
onghuisheng committed Jul 9, 2023
1 parent 9b654d2 commit 64b7292
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/models/android_carrier_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AndroidCarrierData {
isMultiSimSupported: map['isMultiSimSupported'] ?? '',
isSmsCapable: map['isSmsCapable'] ?? false,
telephonyInfo: List<TelephonyInfo>.from(
map['telephonyInfo']?.map((x) => x ?? TelephonyInfo.fromMap(x))),
map['telephonyInfo']?.map((x) => TelephonyInfo.fromMap(x))),
);
}

Expand Down Expand Up @@ -379,7 +379,7 @@ class TelephonyInfo {
displayName: map['displayName'] ?? '',
simState: map['simState'] ?? '',
isoCountryCode: map['isoCountryCode'] ?? '',
cellId: CellId.fromMap(map['cellId']),
cellId: CellId.fromMap(map['cellId'] ?? <dynamic, dynamic>{}),
phoneNumber: map['phoneNumber'] ?? '',
carrierName: map['carrierName'] ?? '',
subscriptionId: map['subscriptionId'] ?? 0,
Expand Down

0 comments on commit 64b7292

Please sign in to comment.