]> git.draconx.ca Git - upkg.git/commitdiff
upkg: Only print object properties if they are non-NULL.
authorNick Bowler <nbowler@draconx.ca>
Wed, 16 May 2012 23:56:42 +0000 (19:56 -0400)
committerNick Bowler <nbowler@draconx.ca>
Wed, 16 May 2012 23:56:42 +0000 (19:56 -0400)
It's valid for a property to be unset, so we should not crash in this
case.

src/upkg.c

index 202876a9b7db37fb5e473219b063d069060b33e1..9213753bb354c9e25148cda27072e102a6b8da6a 100644 (file)
@@ -311,8 +311,7 @@ static int object_info(GTypeModule *pkg, unsigned long idx)
                        if (G_VALUE_HOLDS(&val, U_TYPE_OBJECT)) {
                                UObject *obj = g_value_get_object(&val);
 
-                               /* TODO: Display full object names here. */
-                               if (obj->pkg_name) {
+                               if (obj && obj->pkg_name) {
                                        printf(" %s", obj->pkg_name);
                                }
                        }