Skip to content

Commit 83f4945

Browse files
committed
Fix null pointer bug
#fix #26
1 parent 596ba50 commit 83f4945

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-postgresql",
3-
"version": "0.11.1",
3+
"version": "0.11.2",
44
"description": "Node-RED node for PostgreSQL, supporting parameters, split, back-pressure",
55
"author": {
66
"name": "Alexandre Alapetite",

postgresql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ module.exports = function (RED) {
128128
let fill = 'grey';
129129
if (hasError) {
130130
fill = 'red';
131-
} else if (nbQueue <= 0) {
131+
} else if (nbQueue <= 0 || !node.config.pgPool) {
132132
fill = 'blue';
133133
} else if (nbQueue <= node.config.pgPool.totalCount) {
134134
fill = 'green';
@@ -137,7 +137,7 @@ module.exports = function (RED) {
137137
}
138138
node.status({
139139
fill,
140-
shape: hasError || nbQueue > node.config.pgPool.totalCount ? 'ring' : 'dot',
140+
shape: hasError || !node.config.pgPool || nbQueue > node.config.pgPool.totalCount ? 'ring' : 'dot',
141141
text: 'Queue: ' + nbQueue + (hasError ? ' Error!' : ''),
142142
});
143143
hasError = false;

0 commit comments

Comments
 (0)