[libgdata] youtube: Fix a crash in the error handling code if no GError is passed in
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] youtube: Fix a crash in the error handling code if no GError is passed in
- Date: Fri, 10 Dec 2010 17:54:15 +0000 (UTC)
commit 70e9d50ae9007181e2938ff347118c93810ef1d1
Author: Philip Withnall <philip tecnocode co uk>
Date: Fri Dec 10 16:49:25 2010 +0000
youtube: Fix a crash in the error handling code if no GError is passed in
gdata/services/youtube/gdata-youtube-service.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c
index 5d0dd7e..ec59191 100644
--- a/gdata/services/youtube/gdata-youtube-service.c
+++ b/gdata/services/youtube/gdata-youtube-service.c
@@ -270,7 +270,7 @@ parse_error_response (GDataService *self, GDataOperationType operation_type, gui
}
/* Create an error message, but only for the first error */
- if (*error == NULL) {
+ if (error == NULL || *error == NULL) {
/* See http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Error_responses */
if (xmlStrcmp (domain, (xmlChar*) "yt:service") == 0 && xmlStrcmp (code, (xmlChar*) "disabled_in_maintenance_mode") == 0) {
/* Service disabled */
@@ -318,7 +318,7 @@ parse_error_response (GDataService *self, GDataOperationType operation_type, gui
check_error:
/* Ensure we're actually set an error message */
- if (*error == NULL)
+ if (error != NULL && *error == NULL)
g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("Unknown and unparsable error received."));
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]