Check if hostname null in resource filter 57/72357/2
authorSean Smith <ssmith@iol.unh.edu>
Wed, 7 Apr 2021 19:16:29 +0000 (15:16 -0400)
committerSean Smith <ssmith@iol.unh.edu>
Wed, 7 Apr 2021 19:39:39 +0000 (15:39 -0400)
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: Ie28c83109faf529f0a3bd4c61b1f96e064c1577c

src/static/js/dashboard.js

index 9bd20ef..85a337b 100644 (file)
@@ -418,7 +418,7 @@ class MultipleSelectFilterWidget {
             cnt += required_resources[resource];
         }
 
-        if (cnt > 1) {
+        if (cnt > 1 && hostname && image) {
             hostname.readOnly = true;
             image.disabled = true;
         }
@@ -435,8 +435,11 @@ class MultipleSelectFilterWidget {
             this.available_resources[resource] += required_resources[resource];
         }
 
-        hostname.readOnly = false;
-        image.disabled = false;
+        if (hostname && image) {
+            hostname.readOnly = false;
+            image.disabled = false;
+        }
+
         this.updateAvailibility();
     }