libsysprof-analyze: make string functions recognize NULL

This commit is contained in:
Christian Hergert
2023-05-19 10:13:01 -07:00
parent e1da2d4f70
commit 9e2ddae05c

View File

@ -70,6 +70,9 @@ sysprof_strings_get (SysprofStrings *self,
{
GRefString *ret;
if (string == NULL)
return NULL;
g_mutex_lock (&self->mutex);
if (!(ret = g_hash_table_lookup (self->hashtable, string)))
{
@ -88,6 +91,9 @@ sysprof_strings_lookup (SysprofStrings *self,
{
GRefString *ret;
if (string == NULL)
return NULL;
g_mutex_lock (&self->mutex);
ret = g_hash_table_lookup (self->hashtable, string);
g_mutex_unlock (&self->mutex);