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