Fix getSnapshot logic for non-existent docs