Skip to content

Commit

Permalink
Handle workerData being null
Browse files Browse the repository at this point in the history
  • Loading branch information
Silic0nS0ldier committed Mar 14, 2022
1 parent 86c2bdd commit 9ee077b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default Worker;

// Determine if within worker managed by this library
const workerData = threads.workerData;
if (typeof workerData === 'object' && workerData.id === PACKAGE_IDENTITY && workerData.mod) {
if (workerData && typeof workerData === 'object' && workerData.id === PACKAGE_IDENTITY && workerData.mod) {
workerThread();
}

Expand Down

0 comments on commit 9ee077b

Please sign in to comment.