Check for existance of key before delete

This commit is contained in:
Taylor Gerring 2015-03-12 00:01:18 -05:00
parent 7ee5cb0a81
commit 704914be08
1 changed files with 4 additions and 1 deletions

View File

@ -167,7 +167,10 @@ func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) erro
}
func (self *EthereumApi) UninstallFilter(id int, reply *interface{}) error {
delete(self.logs, id)
if _, ok := self.logs[id]; ok {
delete(self.logs, id)
}
self.filterManager.UninstallFilter(id)
*reply = true
return nil