Adds check for nil before calling blocks. This allows for partial mocks to stub out methods to literally do nothing (instead of their non-stubbed behavior).