prevent NPE when there is no connection
Merge pull request #113 from gacord23/patch-1

prevent NPE when there is no connection