add explicit null check (for hahas?)

SVN revision: 55728
This commit is contained in:
Mike Blumenkrantz 2010-12-23 00:41:19 +00:00
parent 2e647df117
commit 2e4b8b9901
1 changed files with 4 additions and 1 deletions

View File

@ -404,8 +404,11 @@ _cftype_new_from_key(const char *key)
{
const CFTypes *itr;
char name[1024], icon[1024];
size_t key_len = strlen(key);
size_t key_len;
if (!key) return NULL;
key_len = strlen(key);
for (itr = _types; itr->key_len > 0; itr++)
{
if (key_len != itr->key_len) continue;