From 2b20716439dd0f540dbf78cc6eaabf1aa32f8583 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 4 Feb 2013 18:08:13 -0600 Subject: fix: replace COnfigFile with empty string if undefined --- src/rcl_util.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/rcl_util.erl') diff --git a/src/rcl_util.erl b/src/rcl_util.erl index 06d957d..a879c58 100644 --- a/src/rcl_util.erl +++ b/src/rcl_util.erl @@ -25,7 +25,8 @@ to_binary/1, is_error/1, error_reason/1, - indent/1]). + indent/1, + optional_to_string/1]). -define(ONE_LEVEL_INDENT, " "). %%============================================================================ @@ -68,7 +69,11 @@ is_error({error, _}) -> is_error(_) -> false. - +%% @doc convert optional argument to empty string if undefined +optional_to_string(undefined) -> + ""; +optional_to_string(Value) when is_list(Value) -> + Value. %%%=================================================================== %%% Test Functions -- cgit v1.2.3