Fix passing wrong variable the static analyzer found.
Empty arrays are NULL, so cope with that case, just to be safe.
Be paranoid. Static analyzer says this could happen, but I haven't found it yet.