Backport NPE fix in SnapshotManager