Fixing NPE found when not having required host and port properties.