Skip to content

Commit

Permalink
Merge pull request #113 from istnv/bug/upgrade
Browse files Browse the repository at this point in the history
Catch errors when  importing *OLD* configs
  • Loading branch information
istnv authored Oct 29, 2024
2 parents fa0883e + 7909ff1 commit 2a92589
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class BAirInstance extends InstanceBase {
async init(config) {
this.config = config

if (!this.config.model) {
this.config.model = 'X18'
}

if (!this.config.channels) {
this.config.channels = parseInt(this.config.model.replace(/\D/g, ''))
this.saveConfig(this.config)
Expand Down Expand Up @@ -545,7 +549,8 @@ class BAirInstance extends InstanceBase {
if (this.oscPort) {
this.oscPort.close()
}
if (!this.config.host) {
// no host or still default '0.0.0.0'
if (!this.config.host || this.config.host.split('.').reduce((acc, b) => acc + b, 0) == 0) {
this.updateStatus(InstanceStatus.ConnectionFailure, 'No host IP')
} else {
// if (this.config.host) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "behringer-xair",
"version": "2.5.0",
"version": "2.5.1",
"type": "module",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion upgrades.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const UpgradeScripts = [
}

for (let fb of props.feedbacks) {
if (fb.feedbackId?.match(/^solosw_/) && Object.keys(fb.style).length == 0) {
if (fb.feedbackId?.match(/^solosw_/) && Object.keys(fb?.style || {}).length == 0) {
fb.style = {
color: combineRgb(255, 255, 255),
bgcolor: 0,
Expand Down

0 comments on commit 2a92589

Please sign in to comment.