From af337047a4eb323b2c914bf71eeb0b15e33a65a5 Mon Sep 17 00:00:00 2001 From: Facundo Spagnuolo Date: Wed, 17 Jan 2018 12:00:15 -0300 Subject: [PATCH] Fix solint errors --- contracts/mocks/ERC721TokenMock.sol | 2 +- contracts/token/ERC721Token.sol | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/contracts/mocks/ERC721TokenMock.sol b/contracts/mocks/ERC721TokenMock.sol index b14f66641..394d408f4 100644 --- a/contracts/mocks/ERC721TokenMock.sol +++ b/contracts/mocks/ERC721TokenMock.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.18; -import '../token/ERC721Token.sol'; +import "../token/ERC721Token.sol"; /** * @title ERC721TokenMock diff --git a/contracts/token/ERC721Token.sol b/contracts/token/ERC721Token.sol index 53457dd23..8e30fba6e 100644 --- a/contracts/token/ERC721Token.sol +++ b/contracts/token/ERC721Token.sol @@ -1,7 +1,7 @@ pragma solidity ^0.4.18; -import './ERC721.sol'; -import '../math/SafeMath.sol'; +import "./ERC721.sol"; +import "../math/SafeMath.sol"; /** * @title ERC721Token @@ -97,9 +97,10 @@ contract ERC721Token is ERC721 { function approve(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) { address owner = ownerOf(_tokenId); require(_to != owner); - if(approvedFor(_tokenId) == 0 && _to == 0) return; - tokenApprovals[_tokenId] = _to; - Approval(owner, _to, _tokenId); + if (approvedFor(_tokenId) != 0 || _to != 0) { + tokenApprovals[_tokenId] = _to; + Approval(owner, _to, _tokenId); + } } /** @@ -127,7 +128,7 @@ contract ERC721Token is ERC721 { * @param _tokenId uint256 ID of the token being burned by the msg.sender */ function burn(uint256 _tokenId) onlyOwnerOf(_tokenId) internal { - if(approvedFor(_tokenId) != 0) { + if (approvedFor(_tokenId) != 0) { clearApproval(msg.sender, _tokenId); } removeToken(msg.sender, _tokenId);