ERC:721 check for key already present changed

Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
This commit is contained in:
Rajat Sharma 2022-06-14 19:40:25 +05:30 committed by Dave Enyeart
parent e00841bd10
commit 194aff808d

View file

@ -312,7 +312,7 @@ class TokenERC721Contract extends Contract {
//check contract options are not already set, client is not authorized to change them once intitialized
const nameBytes = await ctx.stub.getState(nameKey);
if (!nameBytes || nameBytes.length !== 0) {
if (nameBytes && nameBytes.length > 0) {
throw new Error('contract options are already set, client is not authorized to change them');
}