Bugfix: Don't crash trying to render a new log buffer.
authorBrett Smith <brett@curoverse.com>
Thu, 8 May 2014 17:15:16 +0000 (13:15 -0400)
committerBrett Smith <brett@curoverse.com>
Thu, 8 May 2014 17:15:16 +0000 (13:15 -0400)
If you submit a Job and then try to load your Workbench Dashboard,
Workbench will likely crash because the log_buffer is a symbol at that
time.  This check guards to make sure that we only try to render
actual log content.

apps/workbench/app/views/users/_tables.html.erb

index 10592f5009c9cd80c25b87482cf2c30acb50d582..f62bd5d4e3b73d8c30396fd0d23ae6f6e99c3479 100644 (file)
@@ -58,7 +58,7 @@
           <a href="<%= collection_path(j.log) %>/<%= file[1] %>?disposition=inline&size=<%= file[2] %>">Log</a>
         <% end %>
       <% end %>
-    <% elsif j.respond_to? :log_buffer and j.log_buffer %>
+    <% elsif j.respond_to? :log_buffer and j.log_buffer.is_a? String %>
       <% buf = j.log_buffer.strip.split("\n").last %>
       <span title="<%= buf %>"><%= buf %></span>
     <% end %>