]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
profile: use pass as default profile when config files are corrupted
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 Dec 2014 18:41:10 +0000 (19:41 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 5 Dec 2014 18:41:10 +0000 (19:41 +0100)
src/profile.c

index e844a9a54bc2ba0aeef2dea0a89cf30fa74cd4cf..4795b244ecbfc9e2cdd022eb18f86029a237348c 100644 (file)
@@ -1443,7 +1443,7 @@ profile_init(void)
   }
 
   name = "pass";
-  pro = profile_find_by_name2(name, NULL,);
+  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