Diff between 53cbe8d365661cf87a9a765032c06decf584f7f7 and d4194db7af7e708b66b0cc6ad6c43231e819a3f1

Changed Files

File Additions Deletions Status
src/profile.c +9 -2 modified

Full Patch

diff --git a/src/profile.c b/src/profile.c
index b7f876e..79cb6af 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -1586,6 +1586,8 @@ static void ext_set_defaults(struct ext_profile *ext)
 	ext->enable_client = true;
 	ext->enable_server = true;
 
+	ext->remote_uuids = g_new0(char *, 2);
+
 	for (i = 0; i < G_N_ELEMENTS(defaults); i++) {
 		struct default_settings *settings = &defaults[i];
 		const char *remote_uuid;
@@ -1593,8 +1595,6 @@ static void ext_set_defaults(struct ext_profile *ext)
 		if (strcasecmp(ext->uuid, settings->uuid) != 0)
 			continue;
 
-		ext->remote_uuids = g_new0(char *, 2);
-
 		if (settings->remote_uuid)
 			remote_uuid = settings->remote_uuid;
 		else
@@ -1785,6 +1785,13 @@ static struct ext_profile *create_ext(const char *owner, const char *path,
 	if (!ext->name)
 		ext->name = g_strdup_printf("%s%s/%s", owner, path, uuid);
 
+	if (!ext->remote_uuids[0]) {
+		if (ext->service)
+			ext->remote_uuids[0] = g_strdup(ext->service);
+		else
+			ext->remote_uuids[0] = g_strdup(ext->uuid);
+	}
+
 	p = &ext->p;
 
 	p->name = ext->name;