From cba043f69ef942ed4358dcbcf0783561d4eac159 Mon Sep 17 00:00:00 2001 From: Christian Sarnataro Date: Thu, 8 Sep 2022 17:17:13 +0200 Subject: [PATCH] Fixed wrong static invocation of method to compute the file extension for ESP32 --- src/daemon.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/daemon.js b/src/daemon.js index cf6c191..2e3d769 100644 --- a/src/daemon.js +++ b/src/daemon.js @@ -130,7 +130,7 @@ export default class Daemon { }) .then(result => result.json()) .then(uploadCommandInfo => { - let ext = this._extractExtensionFromCommandline(uploadCommandInfo.commandline); + let ext = Daemon._extractExtensionFromCommandline(uploadCommandInfo.commandline); const data = compilationResult[ext] || compilationResult.bin; if (!ext || !data) { console.log('we received a faulty ext property, defaulting to .bin'); @@ -214,7 +214,7 @@ export default class Daemon { static _extractExtensionFromCommandline(commandline) { const rx = /\{build\.project_name\}\.(\w\w\w)\b/g; const arr = rx.exec(commandline); - if (arr && arr.length) { + if (arr && arr.length > 0) { return arr[1]; } return null;