Skip to content

Commit

Permalink
Fix potential NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerozgen committed Oct 28, 2024
1 parent 3490c62 commit 74e4c3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ loader_version=0.16.7
fabric_version=0.107.0+1.21.3

# Mod Properties
mod_version=1.7+1.21.3
mod_version=1.7.1+1.21.3
maven_group=jerozgen
archives_base_name=language-reload

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ private static List<Text> addFallbackTranslationsToSearchTooltips(ItemStack inst
if (Config.getInstance() == null) return original;
if (!Config.getInstance().multilingualItemSearch) return original;

var translationStorage = ((ILanguage) Language.getInstance()).languagereload_getTranslationStorage();
var language = Language.getInstance();
if (language == null) return original;

var translationStorage = ((ILanguage) language).languagereload_getTranslationStorage();
if (translationStorage == null) return original;

var result = new ArrayList<>(original);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ List<StringVisitable> getOverriddenTranslations() {
if (!Config.getInstance().multilingualItemSearch) return null;

var language = Language.getInstance();
if (language == null) return null;

var translationStorage = ((ILanguage) language).languagereload_getTranslationStorage();
if (translationStorage == null) return null;

Expand Down

0 comments on commit 74e4c3b

Please sign in to comment.