Fix invalid gateway toast message
Add check for gateway value before testing if the string is valid.
The backend seems to handle an empty gateway the same as sending
0.0.0.0. When the GET call is made after sending 0.0.0.0 as the
gateway value, the response returns an empty string. This field
seems to be an override for the default gateway input for the
interface.
Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: Id6a5575e73a7c8adfff052c89bb4e8ca986d45f9
diff --git a/app/configuration/controllers/network-controller.js b/app/configuration/controllers/network-controller.js
index d2d99ba..07a810c 100644
--- a/app/configuration/controllers/network-controller.js
+++ b/app/configuration/controllers/network-controller.js
@@ -105,7 +105,8 @@
$scope.loading = false;
return;
}
- if (!APIUtils.validIPV4IP(
+ if ($scope.interface.ipv4.values[i].Gateway &&
+ !APIUtils.validIPV4IP(
$scope.interface.ipv4.values[i].Gateway)) {
toastService.error(
$scope.interface.ipv4.values[i].Address +