Crashing bug in replacePlaceholdersAndPrintStringFromBlock: #5

Merged
merged 1 commit into from Mar 7, 2014

Conversation

Projects
None yet
2 participants
@stury

stury commented Mar 6, 2014

The method stringByReplacingOccurrencesOfString:withString: throws an
exception if the withString: parameter is nil! Added checks to make
sure we have a value before trying to do the replacement.

A simple example to test this is to run the following code snippet as a terminal app:
NSString* hello = @"Hello, World!";
hello = [hello stringByReplacingOccurrencesOfString:@"World" withString:nil];

You'll get an exception because you've passed in a nil argument in the withString: parameter.

Scott Tury
Crashing bug in replacePlaceholdersAndPrintStringFromBlock:
The method stringByReplacingOccurrencesOfString:withString: throws an
exception if the withString: parameter is nil!  Added checks to make
sure we have a value before trying to do the replacement.
@tomaz

This comment has been minimized.

Show comment
Hide comment
@tomaz

tomaz Mar 7, 2014

Thanks!

tomaz commented on 8b3baec Mar 7, 2014

Thanks!

tomaz added a commit that referenced this pull request Mar 7, 2014

Merge pull request #5 from stury/master
Crashing bug in replacePlaceholdersAndPrintStringFromBlock:

@tomaz tomaz merged commit 2b5b5b4 into tomaz:master Mar 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment