Skip to content

Commit

Permalink
fixup! don't break compatibility with nil parameter
Browse files Browse the repository at this point in the history
if the user had to manually set the container to nil eg to set `params` in `put_blob/4`,
not handling nil values would be backwards incompatible.

Instead, we should just interpret it as an empty list.
  • Loading branch information
noaccOS committed May 1, 2024
1 parent 3c719c8 commit 64a55cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/azurex/blob/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ defmodule Azurex.Blob.Config do
Returns the given configuration keyword list.
If the parameter is a string, it is interpreted as the container for backwards compatibility.
"""
@spec get_connection_params(config_overrides) :: keyword()
@spec get_connection_params(config_overrides | nil) :: keyword()
def get_connection_params(nil), do: []
def get_connection_params(container) when is_binary(container), do: [container: container]
def get_connection_params(config), do: config

Expand Down

0 comments on commit 64a55cf

Please sign in to comment.