Fix null pointer dereference when server goes away
Merge pull request #58 from jcoene/master

Fix null pointer dereference when server goes away