jverkoey/nimbus — Issue #160: NIAttributedLabel crashes on detectLinks with empty string
Author: wlburge
Created: 2012-02-11 17:02:14+00:00
State: open

I am using NIAttributedLabel to display email and phone number in my application. The phone number isn't always set, so it is returned to me as nil or null. When nil, I try to set the phone number to an empty string. When this empty string is passed in to NIAttributedLabel setText or myAttribLabel.text, it crashes on -(void)detectLinks for an unhandled exception.

2012-02-11 10:55:51.422 simpleinout[26313:15803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSDataDetector enumerateMatchesInString:options:range:usingBlock:]: nil argument'