From 51345d50dff11d6fac850e399690235719676021 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 2 Feb 2004 10:19:38 +0000 Subject: check for NULLness and warn if we can't report GError Original commit message from CVS: check for NULLness and warn if we can't report GError --- gst-libs/gst/play/play.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'gst-libs/gst/play/play.c') diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c index ba100fb3..46738fd1 100644 --- a/gst-libs/gst/play/play.c +++ b/gst-libs/gst/play/play.c @@ -1133,12 +1133,19 @@ gst_play_new (GError **error) { GstPlay *play = g_object_new (GST_TYPE_PLAY, NULL); - if ( (error) && (play->priv->error) ) + if (play->priv->error) { - *error = play->priv->error; - play->priv->error = NULL; + if (error) + { + *error = play->priv->error; + play->priv->error = NULL; + } + else + { + g_warning ("Error creating GstPlay object.\n%s", play->priv->error->message); + g_error_free (play->priv->error); + } } - return play; } -- cgit v1.2.1