trim() expects an array.

It is not if preference string doesn't exists, or read
wasn't success.