- Fixed: FStringTable::operator[] would crash when passed a NULL string pointer.

SVN r3401 (trunk)
This commit is contained in:
Randy Heit 2012-03-03 03:19:29 +00:00
parent 676ce338b1
commit 64fb6410cf

View file

@ -324,6 +324,10 @@ size_t FStringTable::ProcessEscapes (char *iptr)
// Finds a string by name and returns its value // Finds a string by name and returns its value
const char *FStringTable::operator[] (const char *name) const const char *FStringTable::operator[] (const char *name) const
{ {
if (name == NULL)
{
return NULL;
}
DWORD bucket = MakeKey (name) & (HASH_SIZE - 1); DWORD bucket = MakeKey (name) & (HASH_SIZE - 1);
StringEntry *entry = Buckets[bucket]; StringEntry *entry = Buckets[bucket];