From 131b8c343d78484d18b74fd1230a43d716bf92cf Mon Sep 17 00:00:00 2001 From: Mathia Haure-Touze Date: Tue, 2 Mar 2021 11:42:39 +0100 Subject: [PATCH] fix: check wether config exists --- lib/step_flow/configuration.ex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/step_flow/configuration.ex b/lib/step_flow/configuration.ex index ea0fc6e..0e8b726 100644 --- a/lib/step_flow/configuration.ex +++ b/lib/step_flow/configuration.ex @@ -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