Added if(block) check. Prevents crash if nil is passed.
Merge pull request #5 from pkluz/master

Added if(block) check. Prevents crash if nil is passed.