diff --git a/package.json b/package.json index 84a2556b6..684fe1279 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.1.0", + "version": "2.1.1", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", diff --git a/src/keeper/contracts/templates/BaseTemplate.abstract.ts b/src/keeper/contracts/templates/BaseTemplate.abstract.ts index 1f5a9c9cc..c7ddd9fbc 100644 --- a/src/keeper/contracts/templates/BaseTemplate.abstract.ts +++ b/src/keeper/contracts/templates/BaseTemplate.abstract.ts @@ -40,10 +40,12 @@ export abstract class BaseTemplate priceData?: PricedMetadataInformation, ): S { const assetPrice = serviceAttributes.price - let tokenAddress - if (assetPrice === undefined || !isAddress(assetPrice.getTokenAddress())) + let tokenAddress = undefined + if (assetPrice && isAddress(assetPrice.getTokenAddress())) + tokenAddress = assetPrice.getTokenAddress() + else if (this.nevermined.utils.token) { tokenAddress = this.nevermined.utils.token.getAddress() - else tokenAddress = assetPrice.getTokenAddress() + } const serviceAgreementTemplate = this.getServiceAgreementTemplate() const _conds = getConditionsByParams(