Fix: YoutubeAPI.make_context(): client_config can be nil

This commit is contained in:
Samantaz Fox 2021-07-26 17:18:17 +02:00
parent ff3fce7afa
commit c39413289a
No known key found for this signature in database
GPG key ID: F42821059186176E

View file

@ -95,7 +95,10 @@ module YoutubeAPI
# Return, as a Hash, the "context" data required to request the # Return, as a Hash, the "context" data required to request the
# youtube API endpoints. # youtube API endpoints.
# #
private def make_context(client_config : ClientConfig) : Hash private def make_context(client_config : ClientConfig | Nil) : Hash
# Use the default client config if nil is passed
client_config ||= DEFAULT_CLIENT_CONFIG
return { return {
"client" => { "client" => {
"hl" => "en", "hl" => "en",