From: Charlie Brej Date: Thu, 25 Jun 2009 10:39:01 +0000 (+0100) Subject: [script] Don't error on object unref of NULL X-Git-Tag: 0.7.0~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7901df33f901885cb206ece9155eb5c0ead43849;p=thirdparty%2Fplymouth.git [script] Don't error on object unref of NULL This follows the usage of free with a NULL as well as ply-image etc. --- diff --git a/src/plugins/splash/script/script-object.c b/src/plugins/splash/script/script-object.c index 59eb296e..115ad3fe 100644 --- a/src/plugins/splash/script/script-object.c +++ b/src/plugins/splash/script/script-object.c @@ -34,6 +34,8 @@ void script_obj_ref (script_obj* obj) void script_obj_unref (script_obj* obj) { + if (!obj) return; + assert(obj->refcount>0); obj->refcount--; if (obj->refcount<=0){ script_obj_free (obj);