Fix for #1699 (error when searching for a non-existent tag)