summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs')
-rw-r--r--src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs b/src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs
index 4822c414..ed7bd60b 100644
--- a/src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs
+++ b/src/StardewModdingAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs
@@ -43,6 +43,11 @@ namespace StardewModdingAPI.Web.Framework.ModRepositories
/// <param name="id">The mod ID in this repository.</param>
public override async Task<ModInfoModel> GetModInfoAsync(string id)
{
+ // validate ID format
+ if (!uint.TryParse(id, out uint _))
+ return new ModInfoModel($"The value '{id}' isn't a valid Chucklefish mod ID, must be an integer ID.");
+
+ // fetch info
try
{
// fetch HTML