base: Context should optional in more error funcs
This commit is contained in:
@@ -39,6 +39,8 @@
|
|||||||
void
|
void
|
||||||
heim_clear_error_message(heim_context context)
|
heim_clear_error_message(heim_context context)
|
||||||
{
|
{
|
||||||
|
if (!context)
|
||||||
|
return;
|
||||||
if (context->error_string)
|
if (context->error_string)
|
||||||
free(context->error_string);
|
free(context->error_string);
|
||||||
context->error_code = 0;
|
context->error_code = 0;
|
||||||
@@ -164,7 +166,7 @@ heim_get_error_string(heim_context context)
|
|||||||
int
|
int
|
||||||
heim_have_error_string(heim_context context)
|
heim_have_error_string(heim_context context)
|
||||||
{
|
{
|
||||||
return context->error_string != NULL;
|
return context && context->error_string != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user