pdmangel / node-red-contrib-openhab2

Other
20 stars 14 forks source link

TypeError: Cannot read property 'items' of null #14

Closed lsafelix75 closed 7 years ago

lsafelix75 commented 7 years ago

I keep getting the above error whenever i choose "items". My node-red, output: Im on openHAB 2.2.0 Build #1070

Welcome to Node-RED

27 Oct 21:30:35 - [info] Node-RED version: v0.17.5 27 Oct 21:30:35 - [info] Node.js version: v8.8.1 27 Oct 21:30:35 - [info] Linux 3.4.113-sun8i arm LE 27 Oct 21:30:37 - [info] Loading palette nodes 27 Oct 21:30:43 - [warn] ------------------------------------------------------ 27 Oct 21:30:43 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node 27 Oct 21:30:43 - [warn] ------------------------------------------------------ 27 Oct 21:30:43 - [info] Settings file : /home/pi/.node-red/settings.js 27 Oct 21:30:43 - [info] User directory : /home/pi/.node-red 27 Oct 21:30:43 - [info] Flows file : /home/pi/.node-red/flows_orangepilite.json 27 Oct 21:30:43 - [info] Creating new flow file 27 Oct 21:30:43 - [info] Starting flows 27 Oct 21:30:43 - [info] Started flows 27 Oct 21:30:43 - [info] Server now running at http://127.0.0.1:1880/ TypeError: Cannot read property 'items' of null at /home/pi/.node-red/node_modules/node-red-contrib-openhab2/77-openhab2.js:267:21 at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5) at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5) at /usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:281:22 at param (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:354:14) at param (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:365:14) at Function.process_params (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:410:3) at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)

pdmangel commented 7 years ago

This can happen if the controller is first time created and the flow has not been saved yet. So first save the flow and then try to select an item. Please let me know if this solves the probleem. I'll try to solve the issue in a user friendly way.:blush:

pdmangel commented 7 years ago

Fix provided in version 1.0.8