diff --git a/app/build.gradle b/app/build.gradle index 36a2297125..18ed176252 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,8 +52,8 @@ android { applicationId "io.stormbird.wallet" minSdk 24 targetSdk 34 - versionCode 267 - versionName "3.82" + versionCode 268 + versionName "3.83" android.buildFeatures.buildConfig true diff --git a/app/src/main/java/com/alphawallet/app/entity/walletconnect/WalletConnectV2SessionItem.java b/app/src/main/java/com/alphawallet/app/entity/walletconnect/WalletConnectV2SessionItem.java index c8732eeb28..b533de21a5 100644 --- a/app/src/main/java/com/alphawallet/app/entity/walletconnect/WalletConnectV2SessionItem.java +++ b/app/src/main/java/com/alphawallet/app/entity/walletconnect/WalletConnectV2SessionItem.java @@ -2,6 +2,7 @@ import android.os.Parcel; import android.os.Parcelable; +import android.text.TextUtils; import com.walletconnect.web3.wallet.client.Wallet; @@ -20,9 +21,9 @@ public class WalletConnectV2SessionItem extends WalletConnectSessionItem impleme public WalletConnectV2SessionItem(Wallet.Model.Session s) { super(); - name = Objects.requireNonNull(s.getMetaData()).getName(); - url = Objects.requireNonNull(s.getMetaData()).getUrl(); - icon = s.getMetaData().getIcons().isEmpty() ? null : s.getMetaData().getIcons().get(0); + name = s.getMetaData() != null && !TextUtils.isEmpty((s.getMetaData()).getName()) ? (s.getMetaData()).getName() : ""; + url = s.getMetaData() != null && !TextUtils.isEmpty((s.getMetaData()).getName()) ? (s.getMetaData()).getUrl() : ""; + icon = s.getMetaData() != null && !s.getMetaData().getIcons().isEmpty() ? s.getMetaData().getIcons().get(0) : null; sessionId = s.getTopic(); localSessionId = s.getTopic(); settled = true; diff --git a/app/src/main/java/com/alphawallet/app/interact/WalletConnectInteract.java b/app/src/main/java/com/alphawallet/app/interact/WalletConnectInteract.java index dda05ee36c..f4626d5219 100644 --- a/app/src/main/java/com/alphawallet/app/interact/WalletConnectInteract.java +++ b/app/src/main/java/com/alphawallet/app/interact/WalletConnectInteract.java @@ -1,5 +1,7 @@ package com.alphawallet.app.interact; +import android.text.TextUtils; + import com.alphawallet.app.entity.walletconnect.WalletConnectSessionItem; import com.alphawallet.app.entity.walletconnect.WalletConnectV2SessionItem; import com.walletconnect.web3.wallet.client.Wallet; @@ -51,10 +53,13 @@ private List getWalletConnectV2SessionItems() List result = new ArrayList<>(); try { - List listOfSettledSessions = Web3Wallet.INSTANCE.getListOfActiveSessions(); + List listOfSettledSessions = Web3Wallet.getListOfActiveSessions(); for (Wallet.Model.Session session : listOfSettledSessions) { - result.add(new WalletConnectV2SessionItem(session)); + if (session.getMetaData() != null && !(TextUtils.isEmpty(session.getMetaData().name) && TextUtils.isEmpty(session.getMetaData().url))) + { + result.add(new WalletConnectV2SessionItem(session)); + } } } catch (IllegalStateException e)