Prevent NPE when socket could not be created.