Guard against null client in MQTT nodes Fixes #130
Guard against null client in MQTT nodes
Fixes #130

There was a timing window where a client could connect to a broker just as new flows were deployed that would cause the on-connect callback to be called after client has been set to null. This caused an NPE.

The fix is to check client isn't null in the event handler.

zcpara/robot_gui_program,dorado-lmz/node-red,michaelsteenkamp/node-red,avinod1987/NodeRed,redconnect-io/node-red,rntdrts/node-red,Kazuki-Nakanishi/node-red,retailos/node-red,PaGury/node-red,FlowDesigner/node-red,iotcafe/node-red,Tizen-Sunfish/ehf-node-red,darcy202/node-red,nuroglu/cloudgate,anusornc/node-red,rdrm2014/node-red,monteslu/pagenodes,mikestebbins/node-red,zcpara/robot_gui_program,btsimonh/node-red,cloudfoundry-community/node-red-cf-ready,ppillip/node-red,emiloberg/node-red,iotcafe/node-red,fcollova/node-red,Ubicall/node-red,udayanga91/node-red,retailos/node-red,ddm/node-red,MADAR15/IoT-Modeler,retailos/node-red,ioglue/ioglue,mw75/node-red,mw75/node-red,PaGury/node-red,fpt-software/seniot-data-workflow,syzer/node-red,darcy202/node-red,cloudfoundry-community/node-red-cf-ready,HiroyasuNishiyama/node-red,HiroyasuNishiyama/node-red,coderofsalvation/node-red,redcom/node-red-freeboard,dorado-lmz/node-red,ddm/node-red,udayanga91/node-red,zcpara/robot_gui_program,emiloberg/node-red,estbeetoo/beetoo-controller,dbuentello/node-red,tak4hir0/node-red,knolleary/node-red,node-red/node-red,Ubicall/node-red,cgvarela/node-red,iotcafe/node-red,syzer/node-red,the-osgarden/pi-nodered-osg,fcollova/node-red,cgvarela/node-red,mw75/node-red,coderofsalvation/node-red,dorado-lmz/node-red,ioglue/ioglue,wajnberg/node-red,MaxXx1313/my-node-red,lucciano/node-red,olopez32/node-red,MaxXx1313/my-node-red,dojot/mashup,modulexcite/node-red,whoGloo/node-red,codeaudit/node-red,anusornc/node-red,dbuentello/node-red,giovannicuriel/mashup,HiroyasuNishiyama/node-red,xively/habanero,node-red/node-red,whoGloo/node-red,beni55/node-red,nosun/node-red,ppillip/node-red,mw75/node-red,redcom/node-red-freeboard,whummer/node-red,whummer/node-red,ChipSoftTech/HANDS2,gbraad/node-red,avinod1987/Node-Red,dojot/mashup,rntdrts/node-red,MADAR15/IoT-Modeler,whummer/node-red,avinod1987/NodeRed,udayanga91/node-red,wajnberg/node-red,dbuentello/node-red,weitingchou/humix-think,estbeetoo/beetoo-controller,the-osgarden/pi-nodered-osg,fpt-software/seniot-data-workflow,MaxXx1313/my-node-red,olopez32/node-red,syzer/node-red,redcom/node-red-freeboard,the-osgarden/pi-nodered-osg,rntdrts/node-red,avinod1987/Node-Red,weitingchou/humix-think,fcollova/node-red,nuroglu/cloudgate,drwoods/node-red,modulexcite/node-red,FlowDesigner/node-red,PaGury/node-red,nosun/node-red,dorado-lmz/node-red,xively/habanero,cloudfoundry-community/node-red-cf-ready,lucciano/node-red,tak4hir0/node-red,whoGloo/node-red,iotcafe/node-red,mikestebbins/node-red,lostinthestory/node-red,dojot/mashup,drwoods/node-red,michaelsteenkamp/node-red,avinod1987/Node-Red,wajnberg/node-red,lucciano/node-red,monteslu/nodered-for-upstream,node-red/node-red,fpt-software/seniot-data-workflow,lostinthestory/node-red,ty4tw/node-red,nosun/node-red,wajnberg/node-red,zcpara/robot_gui_program,weitingchou/humix-think,gbraad/node-red,MADAR15/IoT-Modeler,augustnmonteiro/skills-visual-programming,monteslu/pagenodes,ppillip/node-red,modulexcite/node-red,redcom/node-red-freeboard,kanki8086/node-red,ilc-opensource/mcf,gbraad/node-red,fcollova/node-red,ChipSoftTech/HANDS2,giovannicuriel/mashup,namgk/node-red,knolleary/node-red,codeaudit/node-red,weitingchou/humix-think,emiloberg/node-red,coderofsalvation/node-red,ddm/node-red,the-osgarden/pi-nodered-osg,ioglue/ioglue,avinod1987/Node-Red,kanki8086/node-red,beni55/node-red,FlowDesigner/node-red,kanki8086/node-red,dbuentello/node-red,darcy202/node-red,codeaudit/node-red,modulexcite/node-red,michaelsteenkamp/node-red,beni55/node-red,giovannicuriel/mashup,drwoods/node-red,avinod1987/NodeRed,codeaudit/node-red,drwoods/node-red,rdrm2014/node-red,giovannicuriel/mashup,whoGloo/node-red,nuroglu/cloudgate,namgk/node-red,augustnmonteiro/skills-visual-programming,ddm/node-red,whummer/node-red,btsimonh/node-red,redconnect-io/node-red,Tizen-Sunfish/ehf-node-red,Kazuki-Nakanishi/node-red,olopez32/node-red,mikestebbins/node-red,avinod1987/NodeRed,anusornc/node-red,ty4tw/node-red,rdrm2014/node-red,beni55/node-red,ChipSoftTech/HANDS2,anusornc/node-red,kanki8086/node-red,lucciano/node-red,udayanga91/node-red,Kazuki-Nakanishi/node-red,xively/habanero,mblackstock/node-red-contrib,btsimonh/node-red,mikestebbins/node-red,lostinthestory/node-red,MaxXx1313/my-node-red,lostinthestory/node-red,xively/habanero,nuroglu/cloudgate,rdrm2014/node-red,estbeetoo/beetoo-controller,darcy202/node-red,gbraad/node-red,augustnmonteiro/skills-visual-programming,redconnect-io/node-red,redconnect-io/node-red,FlowDesigner/node-red,coderofsalvation/node-red,knolleary/node-red,cgvarela/node-red,ppillip/node-red,dojot/mashup,michaelsteenkamp/node-red,PaGury/node-red,Ubicall/node-red,ty4tw/node-red,Ubicall/node-red,nosun/node-red,knolleary/node-red,cloudfoundry-community/node-red-cf-ready,retailos/node-red,ChipSoftTech/HANDS2,mblackstock/node-red-contrib,augustnmonteiro/skills-visual-programming,Kazuki-Nakanishi/node-red,estbeetoo/beetoo-controller,syzer/node-red,cgvarela/node-red,olopez32/node-red,fpt-software/seniot-data-workflow