summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-09-24 19:04:00 -0500
committerErkin Bahceci <erkinbah@gmail.com>2009-09-24 19:04:00 -0500
commitc08a69a7e917209d88bc45e2c82c1a4a40d1969a (patch)
treec90f8d4e0b0ee4a0a2c87eaba86093f364555216
parent7d8ba7d820e43af40e2b8407fbb5606ff10c501f (diff)
downloadcompizconfig-backend-gsettings-c08a69a7e917209d88bc45e2c82c1a4a40d1969a.tar.gz
compizconfig-backend-gsettings-c08a69a7e917209d88bc45e2c82c1a4a40d1969a.tar.bz2
Fix crash (LP: #407020).
-rw-r--r--settings-backend/gconf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/settings-backend/gconf.c b/settings-backend/gconf.c
index 6a1d30a..7cca9b3 100644
--- a/settings-backend/gconf.c
+++ b/settings-backend/gconf.c
@@ -1834,17 +1834,20 @@ checkProfile (CCSContext *context)
else
currentProfile = strdup (profile);
- if (strcmp (lastProfile, currentProfile) != 0)
+ if (!lastProfile || strcmp (lastProfile, currentProfile) != 0)
{
char *pathName;
- /* copy /apps/compiz tree to profile path */
- asprintf (&pathName, "%s/%s", PROFILEPATH, lastProfile);
- if (pathName)
+ if (lastProfile)
{
- copyGconfTree (context, COMPIZ, pathName,
- TRUE, "/schemas" COMPIZ);
- free (pathName);
+ /* copy /apps/compiz tree to profile path */
+ asprintf (&pathName, "%s/%s", PROFILEPATH, lastProfile);
+ if (pathName)
+ {
+ copyGconfTree (context, COMPIZ, pathName,
+ TRUE, "/schemas" COMPIZ);
+ free (pathName);
+ }
}
/* reset /apps/compiz tree */