Skip to content

Commit 57e1cd4

Browse files
authored
Merge pull request #188 from liberaldev/prevent-nil-exception
Prevent nil exceptions in helper.rb under exceptionally unusual conditions
2 parents 091c90c + 2d67ba6 commit 57e1cd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ class Helper
44
@@navigator = $window&.navigator
55

66
def self.ios?
7-
@@navigator.user_agent&.match?(/\b(iPad|iPhone|iPod)\b/) || false
7+
@@navigator&.user_agent&.match?(/\b(iPad|iPhone|iPod)\b/) || false
88
end
99

1010
def self.macos?
11-
@@navigator.user_agent&.match?(/\bMac\b/) || false
11+
@@navigator&.user_agent&.match?(/\bMac\b/) || false
1212
end
1313
end

0 commit comments

Comments
 (0)