Skip to content

Commit fd8ef93

Browse files
committed
UPBGE: Check for invalid id.lib in GetFontId.
Object not loaded from a library have a id.lib to NULL, they use KG_GetMainPath() so. Fix issue #418.
1 parent a68564c commit fd8ef93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/gameengine/Ketsji/KX_FontObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int GetFontId(VFont *vfont)
261261
// convert from absolute to relative
262262
char expanded[FILE_MAX];
263263
BLI_strncpy(expanded, filepath, FILE_MAX);
264-
BLI_path_abs(expanded, vfont->id.lib->filepath);
264+
BLI_path_abs(expanded, vfont->id.lib ? vfont->id.lib->name : KX_GetMainPath().c_str());
265265

266266
fontid = BLF_load(expanded);
267267

0 commit comments

Comments
 (0)