IgnitionModuleDevelopmentCommunity / IgnitionNode-RED

Adds support for Node-RED
Apache License 2.0
31 stars 7 forks source link

null exception on browsing non-existent tag paths #39

Open JoeZeng133 opened 5 months ago

JoeZeng133 commented 5 months ago

if you use the tag browse node to browse a non-existent tag path, you get the following error:

JSON error: SyntaxError: Unexpected token < in JSON at position 0

it is not clear to the users what actually happened. on the ignition log, it shows a null-pointer exception. My guess is that the exception comes from this line of code if tagDescriptions becomes null https://github.com/IgnitionModuleDevelopmentCommunity/IgnitionNode-RED/blob/bbd0657455af39e6346b9b591af210dceff83a15/IgnitionNodeRED-gateway/src/main/java/org/imdc/nodered/servlet/NodeREDServlet.java#L265 I think it makes sense to handle this error and report back to users that the tag path is non-existent in the result object instead of returning 500 status code.

iatraviscox commented 1 month ago

Fixed this issue in 1.5.16:

https://github.com/IgnitionModuleDevelopmentCommunity/IgnitionNode-RED/releases/tag/1.5.16