core/tags/album: Check for empty artist names before fetching album art

Otherwise we might crash when we attempt to look at ar_tokens[0].

Reported-by: Josh Larson <themutatedshrimp@gmail.com>
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2018-02-28 10:28:59 -05:00
parent edcba6a353
commit cce8666140
1 changed files with 2 additions and 1 deletions

View File

@ -138,7 +138,8 @@ static bool __album_query_artist(struct album *album, struct artist *al_artist,
gchar *release, *artist, *year;
bool found = false;
if (!al_artist || strcmp(al_artist->ar_tokens[0], "various") == 0)
if (!al_artist || !string_length(al_artist->ar_name) ||
strcmp(al_artist->ar_tokens[0], "various") == 0)
return false;
release = g_strdup_printf("release:\"%s\"~", lower);