Perform the check for the NULL key earlier
The previous commit added a check for a NULL key inside the filter functions, but it's more efficient to handle it early on, before even calling the filter function.
This commit is contained in:
parent
efc9236fbc
commit
0f677fcaac
@ -803,7 +803,7 @@ dc_descriptor_get_transports (dc_descriptor_t *descriptor)
|
||||
int
|
||||
dc_descriptor_filter (dc_descriptor_t *descriptor, dc_transport_t transport, const void *userdata, void *params)
|
||||
{
|
||||
if (descriptor == NULL || descriptor->filter == NULL)
|
||||
if (descriptor == NULL || descriptor->filter == NULL || userdata == NULL)
|
||||
return 1;
|
||||
|
||||
return descriptor->filter (transport, userdata, params);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user