[gupnp-av] Avoid warnings when protocolInfo is missing
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-av] Avoid warnings when protocolInfo is missing
- Date: Wed, 24 Dec 2014 11:14:44 +0000 (UTC)
commit 163ea5e3d5f5baafa740acbb9007ecbf93860ca6
Author: Sven Neumann <neumann teufel de>
Date: Mon Nov 17 10:49:03 2014 +0100
Avoid warnings when protocolInfo is missing
There should not be run-time warnings when the protocolInfo is
missing in an DIDL-Lite XML fragment.
Signed-off-by: Sven Neumann <neumann teufel de>
https://bugzilla.gnome.org/show_bug.cgi?id=740265
libgupnp-av/gupnp-didl-lite-object.c | 3 +++
libgupnp-av/gupnp-didl-lite-resource.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libgupnp-av/gupnp-didl-lite-object.c b/libgupnp-av/gupnp-didl-lite-object.c
index 3cd421e..9d669d7 100644
--- a/libgupnp-av/gupnp-didl-lite-object.c
+++ b/libgupnp-av/gupnp-didl-lite-object.c
@@ -835,6 +835,9 @@ is_resource_compatible (GUPnPDIDLLiteResource *resource,
res_info = gupnp_didl_lite_resource_get_protocol_info
(resource);
+ if (res_info == NULL)
+ continue;
+
ret = gupnp_protocol_info_is_compatible (info, res_info);
g_object_unref (info);
diff --git a/libgupnp-av/gupnp-didl-lite-resource.c b/libgupnp-av/gupnp-didl-lite-resource.c
index f524207..eddabfc 100644
--- a/libgupnp-av/gupnp-didl-lite-resource.c
+++ b/libgupnp-av/gupnp-didl-lite-resource.c
@@ -980,7 +980,8 @@ gupnp_didl_lite_resource_get_protocol_info (GUPnPDIDLLiteResource *resource)
protocol_info = xml_util_get_attribute_content
(resource->priv->xml_node,
"protocolInfo");
- g_return_val_if_fail (protocol_info != NULL, NULL);
+ if (protocol_info == NULL)
+ return NULL;
error = NULL;
info = gupnp_protocol_info_new_from_string (protocol_info, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]