From d7bfed5cb33e5b6e3dea2db1ec12476bdb175702 Mon Sep 17 00:00:00 2001 From: comp500 Date: Tue, 3 May 2022 21:09:41 +0100 Subject: [PATCH] Fix installing without file ID, with no version data in latestfiles --- curseforge/install.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/curseforge/install.go b/curseforge/install.go index 28601da..1fdf036 100644 --- a/curseforge/install.go +++ b/curseforge/install.go @@ -366,7 +366,11 @@ func getLatestFile(modInfoData modInfo, mcVersion string, fileID int, packLoader if !anyFileObtained { return modFileInfo{}, fmt.Errorf("addon %d has no files", modInfoData.ID) } - return modFileInfo{}, errors.New("mod not available for the configured Minecraft version(s) (use the acceptable-game-versions option to accept more) or loader") + + // Possible to reach this point without obtaining file info; particularly from GameVersionLatestFiles + if fileID == 0 { + return modFileInfo{}, errors.New("mod not available for the configured Minecraft version(s) (use the acceptable-game-versions option to accept more) or loader") + } } fileInfoData, err := getFileInfo(modInfoData.ID, fileID)