Skip to content

Commit

Permalink
fix #3729
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jan 5, 2025
1 parent 7f2f449 commit f10d6af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/scala/li/cil/oc/client/Manual.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ object Manual extends ManualAPI {

override def contentFor(path: String): java.lang.Iterable[String] = {
val cleanPath = com.google.common.io.Files.simplifyPath(path)
val language = FMLCommonHandler.instance.getCurrentLanguage
val language = try {
FMLCommonHandler.instance.getCurrentLanguage
} catch {
case t: Throwable =>
OpenComputers.log.warn("The game threw an error when querying current language.", t)
"en_US"
}
contentForWithRedirects(cleanPath.replaceAll(LanguageKey, language)).
orElse(contentForWithRedirects(cleanPath.replaceAll(LanguageKey, FallbackLanguage))).
orNull
Expand Down

0 comments on commit f10d6af

Please sign in to comment.