jnraine/munkiserver — Issue #122: View exception raised when hitting a computer show URL w/o a valid session
Author: jnraine
Created: 2012-01-09 22:43:34+00:00
State: open
Labels: bug

This is occurring the log message that occurs when I copy/paste a URL from a browser that with a valid session to another browser without a valid session.

```code
Started GET "/it-burnaby/computers/aisg-0371" for 142.58.3.168 at 2012-01-09 14:39:43 -0800
Processing by ComputersController#show as HTML
Parameters: {"unit_shortname"=>"it-burnaby", "id"=>"aisg-0371"}
Rendered shared/_record_header.html.erb (2.6ms)
Rendered shared/_inventory.html.erb (7.8ms)
Rendered shared/_pkg_list.html.erb (215.6ms)
Rendered shared/_pkg_list.html.erb (87.4ms)
Rendered shared/_bundle_list.html.erb (460.5ms)
Rendered shared/_pkg_list.html.erb (12.6ms)
Rendered shared/_inventory.html.erb (478.0ms)
Rendered computers/_system_profile.html.erb (508.6ms)
Rendered shared/_helpful_info.html.erb (0.3ms)
Rendered computers/_warranty_status.html.erb (0.3ms)
Rendered computers/_warranty.html.erb (2.2ms)
Rendered shared/_pkg_list.html.erb (235.3ms)
Rendered computers/show.html.erb within layouts/application (2144.9ms)
Completed 500 Internal Server Error in 2154ms

ActionView::Template::Error (undefined method `units' for nil:NilClass):
77:
78:

79:

80:	<%= unit_menu %>
81:

82:

83:
app/helpers/application_helper.rb:131:in `unit_menu'
app/views/layouts/application.html.erb:80:in `_app_views_layouts_application_html_erb__2377828628238572919_2167832060_545330052087661708'
app/controllers/computers_controller.rb:48:in `show'
```

Perhaps the before_filters are redirecting the user to the login page and an error happens to be raised because there are no units for this user because there is no user.