Skip to content

Commit

Permalink
fix: error when unconfirmed message not found jwalton#152
Browse files Browse the repository at this point in the history
  • Loading branch information
luddd3 committed Aug 23, 2021
1 parent 69f1da3 commit 8195c7f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ChannelWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,7 @@ export default class ChannelWrapper extends EventEmitter {

function removeUnconfirmedMessage(arr, message) {
const toRemove = arr.indexOf(message);
if (toRemove === -1) {
throw new Error(`Message is not in _unconfirmedMessages!`);
if (toRemove !== -1) {
arr.splice(toRemove, 1);
}
const removed = arr.splice(toRemove, 1);
return removed[0];
}

0 comments on commit 8195c7f

Please sign in to comment.