Skip to content

Commit

Permalink
fix #263
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu committed Apr 22, 2019
1 parent c8550c1 commit faa276f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).

## 4.0.6 (2019-04-22)

### Bug Fixes

* Fixed issue causing the UI to crash when `platforms` was not present in the Homebridge `config.json` ([#263](https://github.com/oznu/homebridge-config-ui-x/issues/263))

### Other Changes

* Updated npm dependencies

## 4.0.5 (2019-04-21)

### Bug Fixes
Expand Down
34 changes: 16 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-config-ui-x",
"version": "4.0.5",
"version": "4.0.6",
"description": "Configuration UI plugin for Homebridge",
"license": "MIT",
"author": "oznu <[email protected]>",
Expand Down Expand Up @@ -57,7 +57,7 @@
"@oznu/hap-client": "0.0.4",
"@types/express": "^4.16.0",
"@types/fs-extra": "^5.0.5",
"@types/node": "^11.13.5",
"@types/node": "^11.13.6",
"@types/socket.io": "^2.1.2",
"bash-color": "0.0.4",
"buffer-shims": "^1.0.0",
Expand All @@ -71,7 +71,7 @@
"nodemon": "^1.18.11",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"pino-pretty": "^2.6.0",
"pino-pretty": "^2.6.1",
"point-of-view": "^3.2.0",
"prettier": "^1.17.0",
"qr-image": "^3.2.0",
Expand All @@ -84,7 +84,7 @@
"tslint": "^5.16.0",
"typescript": "^3.4.4",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.0",
"webpack-cli": "^3.3.1",
"webpack-node-externals": "^1.7.2"
}
}
2 changes: 1 addition & 1 deletion src/core/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ConfigService {

constructor() {
this.homebridgeConfig = fs.readJSONSync(this.configPath);
this.ui = this.homebridgeConfig.platforms.find(x => x.platform === 'config');
this.ui = Array.isArray(this.homebridgeConfig.platforms) ? this.homebridgeConfig.platforms.find(x => x.platform === 'config') : undefined;

if (!this.ui) {
this.ui = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/config/config.startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function getStartupConfig() {
const configPath = process.env.UIX_CONFIG_PATH || path.resolve(os.homedir(), '.homebridge/config.json');

const homebridgeConfig = await fs.readJSON(configPath);
const ui = homebridgeConfig.platforms.find(x => x.platform === 'config');
const ui = Array.isArray(homebridgeConfig.platforms) ? homebridgeConfig.platforms.find(x => x.platform === 'config') : undefined;

const config = {} as {
host?: '::' | '0.0.0.0' | string;
Expand Down

0 comments on commit faa276f

Please sign in to comment.