square/KIF — pull request #191 by jakerr (2013-01-18 05:46:39+00:00)
Title: Crash fix: Don't add steps to scenarios with skippedByFilter.

Adding a step to a scenario that is
"skippedByFilter" can cause a crash if that
scenario has default tearDown steps because
insertion uses NSMakeRange(...) to decide, where
to insert into self.steps. When, skippedByFilter
the steps array is never initialized, so on first
inspection it may seem like the checks aren't
necessary, since we'd be messaging nil, but the
arguments of the message are still evaluated
causing a crash like so:

*** Terminating app due to uncaught exception \
'NSRangeException', reason: '*** -[NSIndexSet \
initWithIndexesInRange:]: Range {4294967294, 1} \
exceeds maximum index value of NSNotFound - 1'