Skip to content

Commit

Permalink
UPBGE: Check for invalid id.lib in GetFontId.
Browse files Browse the repository at this point in the history
Object not loaded from a library have a id.lib to NULL, they use
KG_GetMainPath() so.

Fix issue #418.
  • Loading branch information
panzergame committed Mar 9, 2017
1 parent a68564c commit fd8ef93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/gameengine/Ketsji/KX_FontObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int GetFontId(VFont *vfont)
// convert from absolute to relative
char expanded[FILE_MAX];
BLI_strncpy(expanded, filepath, FILE_MAX);
BLI_path_abs(expanded, vfont->id.lib->filepath);
BLI_path_abs(expanded, vfont->id.lib ? vfont->id.lib->name : KX_GetMainPath().c_str());

fontid = BLF_load(expanded);

Expand Down

0 comments on commit fd8ef93

Please sign in to comment.