Could -[NSURL URLByResolvingSymlinksInPath] return nil?

Sunday, July 6, 2014

I'am analysing some crash reports from users of my OS X app. From the call stack it looks like the NSURL API I used in my code:

-[NSURL URLByResolvingSymlinksInPath]

returned nil. I thought the API never returns nil so I passed the return url value to another method without nil check, which crashes the application.

So, am I wrong?

Apple documentation says the api will return broken symbolic links if some symbolic links cannot be resolved. And I tried many ways(circular symblink, symlink that points nothing...) to make the API return nil but no success.