diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt index 9719c70ff..db4735aeb 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data.repo +import at.hannibal2.skyhanni.test.command.CopyErrorCommand import com.google.gson.Gson import java.io.* import java.nio.charset.StandardCharsets @@ -79,6 +80,10 @@ object RepoUtils { fun <T> getConstant(repo: File, constant: String, gson: Gson, clazz: Class<T>?): T? { if (repo.exists()) { val jsonFile = File(repo, "constants/$constant.json") + if (!jsonFile.isFile) { + CopyErrorCommand.logError(Error("File '$jsonFile' not found!"), "File in repo missing! ($jsonFile). Try §e/shupdaterepo") + return null + } BufferedReader( InputStreamReader( FileInputStream(jsonFile), |
