13681: Fix workbench for workflows that don't have "hints"
[arvados.git] / apps / workbench / app / controllers / work_units_controller.rb
index a229654c36c84a52eca0a8338c15d1fd92659bf6..8527b4d48cb717b941ab376b68255e917c5797a3 100644 (file)
@@ -110,13 +110,15 @@ class WorkUnitsController < ApplicationController
             input_defaults[cwl_shortname(input[:id])] = input[:default]
           end
         end
-        main[:hints].each do |hint|
-          if hint[:class] == "http://arvados.org/cwl#WorkflowRunnerResources"
-            if hint[:coresMin]
-              runtime_constraints["vcpus"] = hint[:coresMin]
-            end
-            if hint[:ramMin]
-              runtime_constraints["ram"] = hint[:ramMin] * 1024 * 1024
+        if main[:hints]
+          main[:hints].each do |hint|
+            if hint[:class] == "http://arvados.org/cwl#WorkflowRunnerResources"
+              if hint[:coresMin]
+                runtime_constraints["vcpus"] = hint[:coresMin]
+              end
+              if hint[:ramMin]
+                runtime_constraints["ram"] = hint[:ramMin] * 1024 * 1024
+              end
             end
           end
         end