added null checks
indents
Merge pull request #27 from barisusakli/master

added null checks.