toArrayParams fails if there are no params

A small fix for this situation.