Do not blow up trying to run a job if runtime_constraints is set to nil
authorWard Vandewege <ward@curoverse.com>
Thu, 3 Jul 2014 19:03:17 +0000 (15:03 -0400)
committerWard Vandewege <ward@curoverse.com>
Thu, 3 Jul 2014 19:03:42 +0000 (15:03 -0400)
no issue #

services/api/app/models/job.rb

index 8bd308d14b8682e6d56af32bae0b4c71d1c53b19..654778aa4496ec8f7bf5f663ad933392fe43691b 100644 (file)
@@ -104,6 +104,10 @@ class Job < ArvadosModel
   def find_docker_image_locator
     # Find the Collection that holds the Docker image specified in the
     # runtime constraints, and store its locator in docker_image_locator.
+    if runtime_constraints.nil? then
+      self.docker_image_locator = nil
+      return false
+    end
     image_search = runtime_constraints['docker_image']
     image_tag = runtime_constraints['docker_image_tag']
     if image_search.nil?