ripienaar/gdash — pull request #113 by rathboma (2013-09-25 16:20:26+00:00)
Title: check for nil in sinatra_app.rb

I'm not entirely sure what is being checked for here, but when I ran the app with a simple dashboard it gave the stack trace below.
This was simply due to a missing nil check, which I've added, let me know if this is ok.

```
NoMethodError - undefined method `list' for nil:NilClass:
/Users/matthew.rathbone/Projects/oss/gdash/lib/gdash/sinatra_app.rb:225:in `block in '
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `call'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `block in compile!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `[]'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (3 levels) in route!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in `route_eval'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (2 levels) in route!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in `block in process_route'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `catch'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `process_route'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in `block in route!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `each'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `route!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in `dispatch!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `block in call!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `block in invoke'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `catch'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `invoke'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `call!'
/Users/matthew.rathbone/.rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in `call'
```