Skip to content

Commit

Permalink
refactor(core): Don't bother instantiating breadcrumb when type is in…
Browse files Browse the repository at this point in the history
…valid
  • Loading branch information
bengourley committed Nov 19, 2019
1 parent fa55906 commit b245c79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ class BugsnagClient {
// if no message, discard
if (!message) return

const crumb = new BugsnagBreadcrumb(message, metadata, type)

// check the breadcrumb is the list of enabled types
if (!this.config.enabledBreadcrumbTypes || !includes(this.config.enabledBreadcrumbTypes, crumb.type)) return
if (!this.config.enabledBreadcrumbTypes || !includes(this.config.enabledBreadcrumbTypes, type)) return

const crumb = new BugsnagBreadcrumb(message, metadata, type)

// push the valid crumb onto the queue and maintain the length
this.breadcrumbs.push(crumb)
Expand Down

0 comments on commit b245c79

Please sign in to comment.