[library] validate mandatory methods for source or die

This commit is contained in:
whatdoineed2do/Ray 2020-02-06 19:36:24 +00:00
parent 6120551cf5
commit a1a49b9497
1 changed files with 10 additions and 1 deletions

View File

@ -747,7 +747,16 @@ library_init(void)
for (i = 0; sources[i]; i++) for (i = 0; sources[i]; i++)
{ {
if (!sources[i]->init) if (!sources[i]->init)
continue; {
DPRINTF(E_LOG, L_LIB, "BUG: library source '%s' has no init()\n", sources[i]->name);
return -1;
}
if (!sources[i]->metarescan)
{
DPRINTF(E_LOG, L_LIB, "BUG: library source '%s' has no metarescan()\n", sources[i]->name);
return -1;
}
ret = sources[i]->init(); ret = sources[i]->init();
if (ret < 0) if (ret < 0)