Change "try .. catch" statement to "if(consoleMode)" statement for mods folder loading. (#2802)

This commit is contained in:
Alexander Korolyov 2020-07-05 05:27:41 +02:00 committed by GitHub
parent 84a06b7fcb
commit ad89286476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,12 +191,8 @@ object RulesetCache :HashMap<String,Ruleset>() {
this[ruleset.fullName] = Ruleset().apply { load(fileHandle) }
}
var modsHandles: Array<FileHandle>
try {
modsHandles = Gdx.files.local("mods").list()
} catch (ex: NullPointerException) {
modsHandles = FileHandle("mods").list()
}
var modsHandles = if(consoleMode) FileHandle("mods").list()
else Gdx.files.local("mods").list()
for (modFolder in modsHandles) {
if (modFolder.name().startsWith('.')) continue