Fixed error if categories is null
Merge pull request #9 from revogit/master

Fixed error if categories is null