From 62b13f557ab141bd28fcce29036b83a229f5e249 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 5 May 2025 17:19:39 -0400 Subject: [PATCH] Early exit in GameData::parse_repository_category if no repositories are available --- src/gamedata.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gamedata.rs b/src/gamedata.rs index 8371a05..32f151d 100755 --- a/src/gamedata.rs +++ b/src/gamedata.rs @@ -202,6 +202,10 @@ impl GameData { /// Parses a path structure and spits out the corresponding category and repository. fn parse_repository_category(&self, path: &str) -> Option<(&Repository, Category)> { + if self.repositories.is_empty() { + return None + } + let tokens = path.split_once('/')?; let repository_token = tokens.1;