Skip to content

Commit

Permalink
fix: check wether config exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathia Haure-Touze committed Mar 2, 2021
1 parent 16e5433 commit 131b8c3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/step_flow/configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ defmodule StepFlow.Configuration do
def get_var_value(module, key, default \\ nil) do
conf_module = Application.get_env(:step_flow, module)

case Keyword.get(conf_module, key) do
{:system, variable} -> System.get_env(variable)
nil -> default
value -> value
if conf_module != nil do
case Keyword.get(conf_module, key) do
{:system, variable} -> System.get_env(variable)
nil -> default
value -> value
end
else
default
end
end

Expand Down

0 comments on commit 131b8c3

Please sign in to comment.