Skip to content

Commit

Permalink
fix crash when no options are passed
Browse files Browse the repository at this point in the history
  • Loading branch information
karashiiro committed Jan 23, 2020
1 parent 61a8045 commit 429101f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions node-machina-ffxiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ const MachinaFFXIV = (() => {
throw new TypeError("port must be a number.");
} else if (options.port) {
this[port] = options.port;
} else {
this[port] = 13346;
}

if (options.hasWine && typeof options.hasWine !== 'boolean') {
Expand All @@ -114,11 +112,16 @@ const MachinaFFXIV = (() => {
throw new TypeError("winePrefix must be a string.");
} else if (options.winePrefix) {
this[winePrefix] = options.winePrefix;
} else {
this[winePrefix] = "$HOME/.Wine";
}
}

if (!this[port]) {
this[port] = 13346;
}
if (!this[winePrefix]) {
this[winePrefix] = "$HOME/.Wine";
}

// Folders
const remoteDatapath = (options && options.remoteDataPath) || path.join(__dirname, './remote-data');
if (!fs.existsSync(remoteDatapath)) {
Expand Down

0 comments on commit 429101f

Please sign in to comment.