Check if array is null before foreach to avoid NullPointerException
Merge pull request #18 from projectsexception/master

Avoid randoms NullPointerException