diff --git a/caching/superblock.cc b/caching/superblock.cc index 5281afb..a76d8b0 100644 --- a/caching/superblock.cc +++ b/caching/superblock.cc @@ -253,7 +253,9 @@ superblock_traits::pack(superblock const &sb, superblock_disk &disk) disk.write_hits = to_disk(core.write_hits); disk.write_misses = to_disk(core.write_misses); - if (core.version >= 2) + // The version may be overridden, meaning the dirty root may not + // actually be present. + if (core.version >= 2 && core.dirty_root) disk.dirty_root = to_disk(*core.dirty_root); }