diff --git a/app/src/main/java/com/alphawallet/app/service/AssetDefinitionService.java b/app/src/main/java/com/alphawallet/app/service/AssetDefinitionService.java index d4eedaa877..ce3a0c69b4 100644 --- a/app/src/main/java/com/alphawallet/app/service/AssetDefinitionService.java +++ b/app/src/main/java/com/alphawallet/app/service/AssetDefinitionService.java @@ -2817,6 +2817,11 @@ public Map getAttestationFunctionMap(Token att) // Trawl through all attestations in this wallet database and update their collectionId pointer if required public String updateAttestations(TokenDefinition td) { + if (td.getAttestation() == null) + { + return "0"; + } + byte[] preHash = td.getAttestation().getCollectionIdPreHash(); String scriptCollectionId = Numeric.toHexString(Hash.keccak256(preHash)); Wallet wallet = new Wallet(tokensService.getCurrentAddress()); diff --git a/app/src/main/java/com/alphawallet/app/ui/NFTAssetDetailActivity.java b/app/src/main/java/com/alphawallet/app/ui/NFTAssetDetailActivity.java index 9151fd63d5..b1fd8cf821 100644 --- a/app/src/main/java/com/alphawallet/app/ui/NFTAssetDetailActivity.java +++ b/app/src/main/java/com/alphawallet/app/ui/NFTAssetDetailActivity.java @@ -116,7 +116,6 @@ public class NFTAssetDetailActivity extends BaseActivity implements StandardFunc private ActivityResultLauncher getGasSettings; private boolean triggeredReload; private long chainId; - private Disposable disposable; @Override protected void onCreate(@Nullable Bundle savedInstanceState) @@ -176,10 +175,6 @@ protected void onDestroy() viewModel.onDestroy(); super.onDestroy(); tokenImage.onDestroy(); - if (disposable != null && !disposable.isDisposed()) - { - disposable.dispose(); - } } @Override @@ -332,7 +327,7 @@ private void newScriptFound(Boolean status) setTitle(token.getTokenName(viewModel.getAssetDefinitionService(), 1)); - //now re-load the verbs + //now re-load the verbs if already called. If wallet is null this won't complete setupFunctionBar(viewModel.getWallet()); setupAttestation(); @@ -367,8 +362,7 @@ private void startScriptDownload(Boolean status) private void setupFunctionBar(Wallet wallet) { - if (token == null) return; - if (BuildConfig.DEBUG || wallet.type != WalletType.WATCH) + if (token != null && wallet != null && (BuildConfig.DEBUG || wallet.type != WalletType.WATCH)) { FunctionButtonBar functionBar = findViewById(R.id.layoutButtons); functionBar.setupFunctions(this, viewModel.getAssetDefinitionService(), token, null, Collections.singletonList(tokenId));