MDSLab / s4t-lightning-rod

Implementation of the Lightning-rod, the Stack4Things node-side probe (this version works with the standalone version of IoTronic)
http://stack4things.unime.it/
Apache License 2.0
3 stars 8 forks source link

LR crashes when some fields in the configuration file are left empty #12

Closed flongo82 closed 8 years ago

flongo82 commented 8 years ago

If Lightning-rod is run with a configuration file in which field "url_wamp" is left empty, then it crashes with the following error:

 var wampIP = wampUrl.split("//")[1].split(":")[0];
                                               ^

TypeError: Cannot read property 'split' of undefined
    at Object.<anonymous> (/storage/emulated/0/s4t-root/s4t-lightning-rod-master/lightning-rod.js:109:41)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:159:18)
    at node.js:444:3

Same happens if other fields are left empty. This errors should be managed.

npeditto commented 8 years ago

Bug fixed: introduced new configuration checking system.