Fixes crash from exception raised when using a non-nil but empty path with some NSData APIs.