Skip to content

Commit 6feaf59

Browse files
authored
fix: broken TranslationServer when added translation fails to load (GodotModding#414)
fixed broken TranslationServer when added translation fails to load
1 parent 3212f1a commit 6feaf59

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

addons/mod_loader/api/mod.gd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ static func add_translation(resource_path: String) -> void:
7373
return
7474

7575
var translation_object: Translation = load(resource_path)
76-
TranslationServer.add_translation(translation_object)
77-
ModLoaderLog.info("Added Translation from Resource -> %s" % resource_path, LOG_NAME)
76+
if translation_object:
77+
TranslationServer.add_translation(translation_object)
78+
ModLoaderLog.info("Added Translation from Resource -> %s" % resource_path, LOG_NAME)
79+
else:
80+
ModLoaderLog.fatal("Failed to load translation at path: %s" % [resource_path], LOG_NAME)
81+
7882

7983
## [i]Note: This function requires Godot 4.3 or higher.[/i][br]
8084
##[br]

0 commit comments

Comments
 (0)