Skip to content

Commit 4003971

Browse files
KANAjetztpirey0
andauthored
fix: broken TranslationServer when added translation fails to load (#… (#520)
fix: broken TranslationServer when added translation fails to load (#414) fixed broken TranslationServer when added translation fails to load Co-authored-by: Luca Martinelli <[email protected]>
1 parent b155e84 commit 4003971

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
@@ -71,8 +71,12 @@ static func add_translation(resource_path: String) -> void:
7171
return
7272

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

7781

7882
# Appends a new node to a modified scene.

0 commit comments

Comments
 (0)