summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontregistry.cpp
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-20 12:59:16 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-20 12:59:16 -0700
commit85c4d40614b501d401159b9bb064a4f4c726265e (patch)
treeef610b296660a2969d4df60ef331a3b4b411b676 /indra/llrender/llfontregistry.cpp
parenta68b34eadf99c5875f2d7692185706e490e850bd (diff)
parentb0dccf883ad67e43b9fac5bc81f7b79bf9c07f8c (diff)
merge
Diffstat (limited to 'indra/llrender/llfontregistry.cpp')
-rw-r--r--indra/llrender/llfontregistry.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp
index 45573cd817..7a3d6ec4f2 100644
--- a/indra/llrender/llfontregistry.cpp
+++ b/indra/llrender/llfontregistry.cpp
@@ -380,7 +380,10 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
LLFontDescriptor nearest_exact_desc = *match_desc;
nearest_exact_desc.setSize(norm_desc.getSize());
font_reg_map_t::iterator it = mFontMap.find(nearest_exact_desc);
- if (it != mFontMap.end())
+ // If we fail to find a font in the fonts directory, it->second might be NULL.
+ // We shouldn't construcnt a font with a NULL mFontFreetype.
+ // This may not be the best solution, but it at least prevents a crash.
+ if (it != mFontMap.end() && it->second != NULL)
{
llinfos << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << llendl;