Fix "undefined method `is_builder?' for nil:NilClass" in static/error.html.erb.

`CurrentUser.user` may be nil if an exception is raised before it's
initialized.
This commit is contained in:
evazion
2017-12-23 18:27:04 -06:00
parent 5f1b7da95d
commit 0d69c03249

View File

@@ -1,4 +1,4 @@
<% if CurrentUser.user.is_builder? && @exception.present? %>
<% if CurrentUser.user.try(:is_builder?) && @exception.present? %>
<h1><%= @exception.class.to_s %> exception raised</h1>
<ul style="font-family: monospace; font-size: 1.2em; list-style-type: none;">
<li><%= @exception.message.dup.force_encoding("utf-8") %></li>