Skip to content

Commit

Permalink
Solve issue when config is not in JSON format
Browse files Browse the repository at this point in the history
  • Loading branch information
cpoder committed Jul 8, 2024
1 parent 7302caa commit fe69951
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/lora-package/src/devices/devices.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ export class DevicesComponent implements OnInit {
const { data, res, paging } = await this.inventory.detail(deviceId);
this.device = data;
if (this.device.c8y_Configuration && this.device.c8y_Configuration.config) {
this.parameterValues = JSON.parse(this.device.c8y_Configuration.config);
try {
this.parameterValues = JSON.parse(this.device.c8y_Configuration.config);
} catch (e) {
console.error("Config doesn't contain JSON");
}
}
this.debugMode = data.debug;
this.storeLast = data.storeLast;
Expand Down

0 comments on commit fe69951

Please sign in to comment.