If it is missing or zero it is appropriate to update it. But has_key? would also work. 

> On Oct 30, 2013, at 12:15 PM, tobyk100 <notifications@github.com> wrote:
> 
> In app/controllers/activities_controller.rb:
> 
> >  
> >        begin
> >          trophy_updates = trophy_check(current_user)
> >        rescue Exception => e
> >          Rails.logger.error "Error updating trophy exception: #{e.inspect}"
> >        end
> > +    else
> > +    session_progress = session[:progress] || {}
> > +      
> > +      if !session_progress[level.id] || (test_result > session_progress[level.id])
> by !session_progress[level.id] are you testing session_progress.has_key?(level.id) is it possible that it's present but false?
> 
> —
> Reply to this email directly or view it on GitHub.