rust/hg-core/src/revlog/revlog.rs
changeset 48236 f8dc78716ad2
parent 48227 4518d91f02d8
child 48457 1fb3615dfce2
--- a/rust/hg-core/src/revlog/revlog.rs	Fri Oct 15 01:27:39 2021 +0200
+++ b/rust/hg-core/src/revlog/revlog.rs	Thu Oct 14 19:02:08 2021 +0100
@@ -133,6 +133,9 @@
     /// Returns the node ID for the given revision number, if it exists in this
     /// revlog
     pub fn node_from_rev(&self, rev: Revision) -> Option<&Node> {
+        if rev == NULL_REVISION {
+            return Some(&NULL_NODE);
+        }
         Some(self.index.get_entry(rev)?.hash())
     }