lib/user_agent/browsers/wechat_browser.rb in useragent-0.16.9 vs lib/user_agent/browsers/wechat_browser.rb in useragent-0.16.10
- old
+ new
@@ -13,11 +13,11 @@
micro_messenger = detect_product("MicroMessenger")
Version.new(micro_messenger.version)
end
def platform
- return unless application
+ return unless application && application.comment
if application.comment[0] =~ /iPhone/
'iPhone'
elsif application.comment.any? { |c| c =~ /Android/ }
'Android'
@@ -25,10 +25,10 @@
application.comment[0]
end
end
def os
- return unless application
+ return unless application && application.comment
if application.comment[0] =~ /Windows NT/
OperatingSystems.normalize_os(application.comment[0])
elsif application.comment[2].nil?
OperatingSystems.normalize_os(application.comment[1])