preventing null pointer during connection if hostname is nil
Merge pull request #1 from ndresselhaus/master

preventing null pointer during connection if hostname is nil