summaryrefslogtreecommitdiff
path: root/backends/alsa/alsa-stream.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2016-01-04 20:31:14 +0100
committerMichal Ratajsky <[email protected]>2016-01-04 20:31:14 +0100
commit9772797c31ebed2417b42a9389caae1b16847e86 (patch)
tree0257271d6f8387ce89984bf8341b11186381c8d5 /backends/alsa/alsa-stream.c
parentd32ca3f420d036cd750fc1aad7f95da40559cc5d (diff)
downloadlibmatemixer-9772797c31ebed2417b42a9389caae1b16847e86.tar.bz2
libmatemixer-9772797c31ebed2417b42a9389caae1b16847e86.tar.xz
Improve error checking in many places
Diffstat (limited to 'backends/alsa/alsa-stream.c')
-rw-r--r--backends/alsa/alsa-stream.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/backends/alsa/alsa-stream.c b/backends/alsa/alsa-stream.c
index bce66ec..fc72f65 100644
--- a/backends/alsa/alsa-stream.c
+++ b/backends/alsa/alsa-stream.c
@@ -20,6 +20,7 @@
#include <libmatemixer/matemixer.h>
#include <libmatemixer/matemixer-private.h>
+#include "alsa-device.h"
#include "alsa-element.h"
#include "alsa-stream.h"
#include "alsa-stream-control.h"
@@ -94,7 +95,12 @@ alsa_stream_new (const gchar *name,
MateMixerDevice *device,
MateMixerDirection direction)
{
- const gchar *label = mate_mixer_device_get_label (device);
+ const gchar *label;
+
+ g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (ALSA_IS_DEVICE (device), NULL);
+
+ label = mate_mixer_device_get_label (device);
return g_object_new (ALSA_TYPE_STREAM,
"name", name,