mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-30 01:03:44 -04:00
[smartpl/daap] Fix some error checks after PR #1386
This commit is contained in:
parent
bc1c3e7bd3
commit
17b9ce0969
@ -642,6 +642,9 @@ dmap_query_parse_sql(const char *dmap_query)
|
||||
{
|
||||
struct daap_result result;
|
||||
|
||||
if (!dmap_query)
|
||||
return NULL;
|
||||
|
||||
DPRINTF(E_SPAM, L_DAAP, "Parse DMAP query input '%s'\n", dmap_query);
|
||||
|
||||
if (daap_lex_parse(&result, dmap_query) != 0)
|
||||
|
@ -90,6 +90,12 @@ smartpl_query_parse_string(struct smartpl *smartpl, const char *expression)
|
||||
{
|
||||
struct smartpl_result result;
|
||||
|
||||
if (!expression)
|
||||
{
|
||||
DPRINTF(E_WARN, L_SCAN, "Parse smartpl query input is null\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
DPRINTF(E_SPAM, L_SCAN, "Parse smartpl query input '%s'\n", expression);
|
||||
|
||||
if (smartpl_lex_parse(&result, expression) != 0)
|
||||
@ -98,7 +104,7 @@ smartpl_query_parse_string(struct smartpl *smartpl, const char *expression)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!result.title || !result.where)
|
||||
if (result.title[0] == '\0' || !result.where)
|
||||
{
|
||||
DPRINTF(E_LOG, L_SCAN, "Missing title or filter when parsing '%s'\n", expression);
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user