mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-15 01:48:33 +00:00
fix: Crashfix for unauthenticated user
This commit is contained in:
parent
71ab3dd7ac
commit
41dd481654
@ -12,8 +12,9 @@ module Invidious::Routes::API::V1::Videos
|
||||
|
||||
begin
|
||||
video = get_video(id, region: region)
|
||||
user = env.get("user").as(User)
|
||||
if user.preferences.watch_history
|
||||
|
||||
user = env.get?("user").try &.as?(User)
|
||||
if user && user.preferences.watch_history
|
||||
Invidious::Database::Users.mark_watched(user, id)
|
||||
end
|
||||
rescue ex : NotFoundException
|
||||
|
Loading…
Reference in New Issue
Block a user