From da2ae270f503c84734604220d266b10129ec5df5 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 5 Dec 2014 19:41:10 +0100 Subject: [PATCH] profile: use pass as default profile when config files are corrupted --- src/profile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/profile.c b/src/profile.c index e844a9a5..4795b244 100644 --- a/src/profile.c +++ b/src/profile.c @@ -1443,7 +1443,7 @@ profile_init(void) } name = "pass"; - pro = profile_find_by_name2(name, NULL,1 ); + pro = profile_find_by_name2(name, NULL, 1); if (pro == NULL || strcmp(pro->pro_name, name)) { htsmsg_t *conf; @@ -1550,6 +1550,13 @@ profile_init(void) htsmsg_destroy(conf); } #endif + + /* Assign the default profile if config files are corrupted */ + if (!profile_default) { + pro = profile_find_by_name2("pass", NULL, 1); + assert(pro); + profile_default = pro; + } } void