fhem / fhem/fhem-mirror

Bug in fhemweb.js (SyntaxError: JSON.parse)?

Open
#33 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
22
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm using fhem-docker and updated to 3.0.7-bullseye some days ago (and did also updates of other modules).

Since the update I recognized following error when restarting the container while keeping the fhem web page open:

fhemweb.js line 1215:
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 5 of the JSON data

I had a quick look at the file /www/pgm2/fhemweb.js: `var d = JSON.parse(l);`
If I understand the code correctly, I guess, there should be another check for the content of `l` before passing it to `JSON.parse()`.

In current main, it's [this line](https://github.com/fhem/fhem-mirror/blob/821b97babed331f75c37fe9f8a20bc6d8789c030/fhem/www/pgm2/fhemweb.js#L1200).
Is this a bug or does that error occure because of some other issue?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.