Fix #1385

Get rid of the warnings by checking if the array is empty first.

https://github.com/mybb/mybb/issues/1385
Merge pull request #1531 from Destroy666x/fix1385

Fix #1385