fix: idtyIndex is nullable
This commit is contained in:
parent
a13d19177b
commit
a35d6b5cf2
|
@ -169,7 +169,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
final idtyIndexFrom = await _getIdentityIndexOf(from);
|
||||
final idtyIndexTo = await _getIdentityIndexOf(to);
|
||||
|
||||
if (idtyIndexFrom == 0 || idtyIndexTo == 0) return 0;
|
||||
if (idtyIndexFrom == null || idtyIndexTo == null) return 0;
|
||||
|
||||
final List certData =
|
||||
await _getStorage('cert.certsByReceiver($idtyIndexTo)') ?? [];
|
||||
|
@ -362,7 +362,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
// Provider.of<WalletOptionsProvider>(homeContext, listen: false);
|
||||
|
||||
var idtyIndex = await _getIdentityIndexOf(address);
|
||||
if (idtyIndex == 0) return [];
|
||||
if (idtyIndex == null) return [];
|
||||
|
||||
final Map? idtyData = await _getStorage('identity.identities($idtyIndex)');
|
||||
if (idtyData == null || idtyData['oldOwnerKey'] == null) return [];
|
||||
|
|
|
@ -194,7 +194,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
final toStatus = snapshot.data!['toStatus'] ?? 0;
|
||||
final toStatus = snapshot.data!['toStatus'];
|
||||
|
||||
return Visibility(
|
||||
visible: (snapshot.data != {}),
|
||||
|
@ -272,7 +272,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(height: 9),
|
||||
Text(
|
||||
toStatus == 0
|
||||
toStatus == null
|
||||
? "certify".tr()
|
||||
: "createIdentity".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
|
|
Loading…
Reference in New Issue