diff options
-rw-r--r-- | btrfs-debug-tree.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c index 8ae7270d..cb6c1061 100644 --- a/btrfs-debug-tree.c +++ b/btrfs-debug-tree.c @@ -177,13 +177,14 @@ int main(int ac, char **av) fprintf(stderr, "unable to open %s\n", av[optind]); exit(1); } + root = info->fs_root; + if (!root) { + fprintf(stderr, "unable to open %s\n", av[optind]); + exit(1); + } if (block_only) { - if (!root) { - fprintf(stderr, "unable to open %s\n", av[optind]); - exit(1); - } leaf = read_tree_block(root, block_only, root->leafsize, 0); |