[NSNull length]: unrecognized selector sent to instance in objective-c
<p>I am getting some JSON data from a service, one property is a string to represent an image url, it seems what is returned is NULL, I do the check but XCode breaks before my if statement and generate an exception. this is my code below:</p>

<pre><code>- (void)configureCellForAlbum:(Album *)album {

    self.albumTitle.text = album.albumTitle;
    self.artisteName.text = album.artisteName;
    NSURL *imageUrl = [NSURL URLWithString:album.thumbnail];
    if (imageUrl == nil) {
        self.albumThumbnail.image = [UIImage imageNamed:@"music_record"];
    }
    else {
        self.albumThumbnail.imageURL = imageUrl;
    }
}
</code></pre>

<p>the exception is </p>

<blockquote>
  <p>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance.</p>
</blockquote>

<p>How do I do the check so that if the value retured is null, it uses a local image but if not null to use the image string url that is returned?</p>