libpulse: as a special exception, don't require a non-NULL context in pa_context_errno
authorLennart Poettering <lennart@poettering.net>
Wed, 16 Sep 2009 23:37:23 +0000 (01:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 16 Sep 2009 23:37:23 +0000 (01:37 +0200)
src/pulse/context.c

index 894ab2e..23ae30c 100644 (file)
@@ -1045,7 +1045,10 @@ pa_context_state_t pa_context_get_state(pa_context *c) {
 }
 
 int pa_context_errno(pa_context *c) {
-    pa_assert(c);
+
+    if (!c)
+        return PA_ERR_INVALID;
+
     pa_assert(PA_REFCNT_VALUE(c) >= 1);
 
     return c->error;