Skip to content

Commit

Permalink
Merge pull request #16 from tcavenezuela/hotfix/avoid-electron-crash
Browse files Browse the repository at this point in the history
hotfix: Avoid electron crash in FSUIPC initialization
  • Loading branch information
carl0shd authored Feb 5, 2023
2 parents b94faf6 + 3acb080 commit b738774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-ducks-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fsuipc.js': patch
---

Change throw error to warning to avoid a crash in electron platforms.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */

if (process.platform !== 'win32') {
throw new Error('FSUIPC only works on Windows platform');
console.warn('Warning: FSUIPC only works on Windows platforms.');
} else {
const core = require('bindings')('fsuipc.node');

Expand Down

0 comments on commit b738774

Please sign in to comment.