I am doing an iPhone app for news. I am getting news data through `ASIHTTPRequest` and parsing with `JSONKit`. It's working fine when connected to the Internet, however if WiFi connection is off I am getting the following exception and the app crashes:

> 
> Terminating app due to uncaught exception
>  'NSInvalidArgumentException', reason: 'The jsonData argument is NULL.'
> 
> 
> 

Here is my code:

```
- (id)objectWithData: (NSData *)jsonData error: (NSError **)error
{
    if(jsonData == NULL)
    {
        [NSException raise:NSInvalidArgumentException format:@"The jsonData argument is NULL."];
    }

    return([self objectWithUTF8String:(const unsigned char *)[jsonData bytes] length:[jsonData length] error:error]);
}

```

Can anyone help me out?