Permalink
Browse files

Merge pull request #62 from courtland/master

Fix exception when request.format is nil
  • Loading branch information...
2 parents 9edef1d + cf437af commit 3f4389f3e0cd1275b989cdef864ef766fada70aa @benlangfeld committed Jan 27, 2016
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/mobile-fu.rb
View
@@ -126,6 +126,7 @@ def force_tablet_format
# 'Tablet' view.
def set_mobile_format
+ return unless request.format
if request.format.html? && mobile_action? && is_mobile_device? && !request.xhr?
request.format = :mobile unless session[:mobile_view] == false
session[:mobile_view] = true if session[:mobile_view].nil?

0 comments on commit 3f4389f

Please sign in to comment.