Added validation for empty gateway

Change-Id: If1f0df1aae54211c3373db475758eb0abc6819a6
Closes: bug 1264282
Merge "Added validation for empty gateway"