diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/til_settings.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/til_settings.c b/src/til_settings.c index 8aa172b..35bb85c 100644 --- a/src/til_settings.c +++ b/src/til_settings.c @@ -188,13 +188,14 @@ int til_settings_get_and_describe_value(const til_settings_t *settings, const ti assert(settings); assert(desc); assert(res_value); - assert(res_setting); - assert(res_desc); value = til_settings_get_value(settings, desc->key, &setting); if (!value || !setting->desc) { int r; + assert(res_setting); + assert(res_desc); + r = til_setting_desc_clone(desc, res_desc); if (r < 0) return r; @@ -206,8 +207,10 @@ int til_settings_get_and_describe_value(const til_settings_t *settings, const ti } *res_value = value; - *res_setting = setting; - *res_desc = NULL; + if (res_setting) + *res_setting = setting; + if (res_desc) + *res_desc = NULL; return 0; } |