Small bugfix to avoid SQL errors

... when taskIDs list is empty.