Fixes a crash when no mod folders are founded (#515)

* Fixes a crash when no mod folders are founded

Hi

* lemme

---------

Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
This commit is contained in:
TheoDev
2025-01-02 03:09:14 +01:00
committed by GitHub
co-authored by ⍚~Nex
parent 76c07cef30
commit 74884854ea
+6 -1
View File
@@ -93,7 +93,12 @@ class ModsFolder {
public static function getModsList():Array<String> {
var mods:Array<String> = [];
#if MOD_SUPPORT
for(modFolder in FileSystem.readDirectory(modsPath)) {
final modsList:Array<String> = FileSystem.readDirectory(modsPath);
if (modsList == null || modsList.length <= 0)
return mods;
for (modFolder in modsList) {
if (FileSystem.isDirectory('${modsPath}${modFolder}')) {
mods.push(modFolder);
} else {