Fix: Ensure empty arrays don't throw (fixes #1418)

Seemed like a pretty simple fix to ensure this error stops happening.

@btmills