Fix crash if block is nil