aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/tasks
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-04-17 11:40:41 -0300
committerflow <flowlnlnln@gmail.com>2022-05-23 14:42:28 -0300
commitd7f6b3699074b268fd554bd1eb9da68f1e533355 (patch)
treedf9a4e34bc4c851040e80c933cf8858c26503ca5 /launcher/minecraft/mod/tasks
parent4439666e67573a6a36af981fdc68410fdf9e4f9f (diff)
downloadPrismLauncher-d7f6b3699074b268fd554bd1eb9da68f1e533355.tar.gz
PrismLauncher-d7f6b3699074b268fd554bd1eb9da68f1e533355.tar.bz2
PrismLauncher-d7f6b3699074b268fd554bd1eb9da68f1e533355.zip
test+fix: add basic tests and fix issues with it
Diffstat (limited to 'launcher/minecraft/mod/tasks')
-rw-r--r--launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
index 5afbb08a..03a17461 100644
--- a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
+++ b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
@@ -34,8 +34,14 @@ void ModFolderLoadTask::getFromMetadata()
if (entry == "." || entry == "..")
continue;
- entry.chop(5); // Remove .toml at the end
- Mod mod(m_mods_dir, Metadata::get(m_index_dir, entry));
+ auto metadata = Metadata::get(m_index_dir, entry);
+ // TODO: Don't simply return. Instead, show to the user that the metadata is there, but
+ // it's not currently 'installed' (i.e. there's no JAR file yet).
+ if(!metadata.isValid()){
+ return;
+ }
+
+ Mod mod(m_mods_dir, metadata);
m_result->mods[mod.internal_id()] = mod;
}
}