diff --git a/ChangeLog b/ChangeLog index 8f0e778..e0db611 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ btrbk-current source subvolume). * Improved handling of command line subvolume filter for "run", "dryrun" and "tree" actions (closes: #21). + * Bugfix: fixed crash in action "diff". btrbk-0.18.0 diff --git a/btrbk b/btrbk index 64accd0..a18024f 100755 --- a/btrbk +++ b/btrbk @@ -338,8 +338,10 @@ sub config_key($$) my $key = shift || die; TRACE "config_key: context=$node->{CONTEXT}, key=$key"; while(not exists($node->{$key})) { - # note: all config keys exist in root context (at least with default values) - $node = $node->{PARENT} || die; + # note: while all config keys exist in root context (at least with default values), + # we also allow fake configs (CONTEXT="cmdline") which have no PARENT. + return undef unless($node->{PARENT}); + $node = $node->{PARENT}; } TRACE "config_key: found value=" . ($node->{$key} // ""); return $node->{$key};