Skip to content

Commit

Permalink
Bugfix (#12)
Browse files Browse the repository at this point in the history
* Bugfix

Fix a bug, where sometimes the node gets a response from the nordpool API, but the response is not the expected array. This causes the node-RED application to crach.
  • Loading branch information
spannebuen authored Aug 15, 2022
1 parent bab8d8d commit 0dbebdf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nordpool-api-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function (RED) {
done(error)
}
// Check if data is received from API call
if (results.length === 0) {
if (!results || results.length === 0) {
// It seems that all areas support EUR, but not other currencies
if (opts.currency !== 'EUR') {
node.status({ fill: 'yellow', text: 'No data at date. Some areas only support EUR as currency' })
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-nordpool-api-plus",
"version": "4.3.0",
"version": "4.3.1",
"description": "A Node-Red Node for collecting `day ahead` prices from Nord Pool Group.",
"keywords": [
"node-red",
Expand Down

0 comments on commit 0dbebdf

Please sign in to comment.