Fix #1385

Get rid of the warnings by checking if the array is empty first.

https://github.com/mybb/mybb/issues/1385