twitter-archive / CocoaSPDY

SPDY for iOS and OS X
Apache License 2.0
2.39k stars 233 forks source link

nil-check s for [s caseInsensitiveCompare:a]==NSOrderedSame #129

Closed johnkdoe closed 9 years ago

johnkdoe commented 9 years ago

if s is nil, then [s caseInsensitiveComapre:a] will return 0, and 0 is the same as NSOrderedSame, so this equality check incorrectly results in YES (!!)

johnkdoe commented 9 years ago

didn't run into it in live code, but encountered this statement when was doing a blanket cleanup in our company-wide project that uses CocoaSPDY as a sub-project . i don't know if it's possible for HTTPMethod to return nil … in my blunt-instrument approach, it just seemed best to nil-check it. i can live without the change if the API for HTTPMethod guarantees never to return nil …