btrbk: bugfix: fix "list latest" with no snapshots

pull/112/head
Axel Burri 2016-11-12 13:21:33 +01:00
parent b6defaa37f
commit 57be688f6b
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ btrbk-current
* Bugfix: Replace "realpath" with "readlink" in ssh_filter_btrbk.sh
* Add "raw_target_block_size" configuration option (close #105).
* Add "backend" configuration option (experimental).
* Bugfix: fix "list latest" with no snapshots (close #111).
btrbk-0.23.3

2
btrbk
View File

@ -4770,7 +4770,7 @@ MAIN:
unless($found) {
my $latest_snapshot = get_latest_snapshot_child($sroot, $svol);
push @data, { type => "latest_snapshot",
status => ($latest_snapshot->{node}{cgen} == $svol->{node}{gen}) ? "up-to-date" : undef,
status => ($latest_snapshot && ($latest_snapshot->{node}{cgen} == $svol->{node}{gen})) ? "up-to-date" : undef,
vinfo_prefixed_keys("source", $svol),
vinfo_prefixed_keys("snapshot", $latest_snapshot), # all unset if no $latest_snapshot
};