Skip to content

Commit 6aa2969

Browse files
authored
Transparency mode fix (#3251)
1 parent f59c9a1 commit 6aa2969

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/helpers/tours_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ def start_tour(tourable, name)
99

1010
# Renders the given tour to the UI
1111
def render_tour(tourable, name)
12-
tour = tourable.tours.find_by(name: name)
12+
tour = tourable&.tours&.find_by(name: name)
1313
if tour&.active
1414
@tour = tour
1515
end
1616
end
1717

1818
# Renders a "Back to tour" button if there's an active tour
1919
def render_back_to_tour(tourable, name, url)
20-
if tourable.tours.find_by(name: name)&.active?
20+
if tourable&.tours&.find_by(name: name)&.active?
2121
@back_to_tour = url
2222
end
2323
end

0 commit comments

Comments
 (0)