Skip to content

Commit

Permalink
fix(allevents): update decode logic to handle no topics
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmolchany committed Jan 27, 2018
1 parent 3547be3 commit 299bb03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/web3/allevents.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ AllSolidityEvents.prototype.encode = function (options) {

AllSolidityEvents.prototype.decode = function (data) {
data.data = data.data || '';
data.topics = data.topics || [];

if (!utils.isArray(data.topics) || !utils.isString(data.topics[0])) {
console.warn('cannot find event for log');
return data;
}

var eventTopic = data.topics[0].slice(2);
var match = this._json.filter(function (j) {
Expand Down

0 comments on commit 299bb03

Please sign in to comment.