From 7901df33f901885cb206ece9155eb5c0ead43849 Mon Sep 17 00:00:00 2001 From: Charlie Brej Date: Thu, 25 Jun 2009 11:39:01 +0100 Subject: [PATCH] [script] Don't error on object unref of NULL This follows the usage of free with a NULL as well as ply-image etc. --- src/plugins/splash/script/script-object.c | 2 ++ 1 file changed, 2 insertions(+) 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);