Answers.Body: <p>Through Pixel and Tonic's support email, I figured out what the issue was. It turns out one of my entries didn't have a thumbnail and that was why the image was null. Stupid user error! I thought I had checked to make sure everything was good but I guess not. Thanks for the help @BradBell.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-29T23:40:24.837Z
Answers.LastActivityDate: 2015-04-29T23:40:24.837Z
Answers.UserDisplayName: anguiac7
Body: <p>I have entries that contain a single graphic asset. I'm trying to use the graphic as a background image in my template. However, I'm unable to output the URI for the asset. I'm using <code>entry.graphic.first().url</code> but I get an error that the property is null. I'm using the dbug plugin to look at the properties and can see that the asset is being returned, however the URI property is null.</p>
  
  <p>I am looping through entries and am unable to return the URI for any of the graphics. Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: Sorry for the lack of code, guys! Below is my whole content block for the page so far.</p>
  
  <pre><code>&lt;div class="container archive"&gt;
    &lt;h1&gt;Video Archives&lt;/h1&gt;
  
    {% for entry in craft.entries.section('watch').order('seriesStart desc').type('series') %}
      {% set thumb = entry.graphic.first() %}
      &lt;div class="col-md-3 seriesthumb" style="background-image: url('{{thumb.url}}');"&gt;&lt;/div&gt;
    {% endfor %}
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks for the help!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-23T02:01:04.050Z
Comments.Text: I've noticed that if I try and pull the graphic's URI outside of the loop, I'm able to return it. It's when it's in the loop that I can't get the URI.
Comments.UserDisplayName: anguiac7
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-23T05:45:46.990Z
Comments.Text: What loop? Are you overwriting entry with that?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-23T06:02:43.813Z
Comments.Text: Hi anguiac! Can you please edit your question to include a larger code sample? What you've provided so far isn't enough to determine what may be the problem.
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-23T16:52:07.707Z
Comments.Text: After `{% set thumb = entry.graphic.first() %}`, if you `{{ thumb | dbug }}`, is it the image you're expecting?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-23T23:09:24.740Z
Comments.Text: @BradBell yes, I see the properties for the image, but the URI property is NULL. I've re-uploaded and cleared the asset cache but nothing helped.
Comments.UserDisplayName: anguiac7
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-24T00:14:11.177Z
Comments.Text: Are the images saved in the cloud (S3, Rackspace, Google Cloud, etc.)?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-24T03:03:58.733Z
Comments.Text: @BradBell nope, they're in a local folder. If I go into assets and click View Asset I get the correct image and the URL in my address bar is correct.
Comments.UserDisplayName: anguiac7
Tags: <assets><assetfilemodel>
Title: Image asset URI returning null
ThreadText: # Image asset URI returning null
  
  (Asked by: username_0 on 2015-04-23)
  
  I have entries that contain a single graphic asset. I'm trying to use the graphic as a background image in my template. However, I'm unable to output the URI for the asset. I'm using `entry.graphic.first().url` but I get an error that the property is null. I'm using the dbug plugin to look at the properties and can see that the asset is being returned, however the URI property is null.
  
  I am looping through entries and am unable to return the URI for any of the graphics. Any ideas?
  
  Thanks!
  
  EDIT: Sorry for the lack of code, guys! Below is my whole content block for the page so far.
  
  ```
  <div class="container archive">
    <h1>Video Archives</h1>
  
    {% for entry in craft.entries.section('watch').order('seriesStart desc').type('series') %}
      {% set thumb = entry.graphic.first() %}
      <div class="col-md-3 seriesthumb" style="background-image: url('{{thumb.url}}');"></div>
    {% endfor %}
  
  </div>
  
  ```
  
  Thanks for the help!
  
  **Tags:** assets, assetfilemodel
  
  > **Comments:**
  > **username_0**: I've noticed that if I try and pull the graphic's URI outside of the loop, I'm able to return it. It's when it's in the loop that I can't get the URI.  
  > **username_1**: What loop? Are you overwriting entry with that?  
  > **username_2**: Hi anguiac! Can you please edit your question to include a larger code sample? What you've provided so far isn't enough to determine what may be the problem.  
  > **username_3**: After `{% set thumb = entry.graphic.first() %}`, if you `{{ thumb | dbug }}`, is it the image you're expecting?  
  > **username_0**: @username_3 yes, I see the properties for the image, but the URI property is NULL. I've re-uploaded and cleared the asset cache but nothing helped.  
  > **username_3**: Are the images saved in the cloud (S3, Rackspace, Google Cloud, etc.)?  
  > **username_0**: @username_3 nope, they're in a local folder. If I go into assets and click View Asset I get the correct image and the URL in my address bar is correct.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-04-29. Score: 1 | Accepted answer
  
  Through Pixel and Tonic's support email, I figured out what the issue was. It turns out one of my entries didn't have a thumbnail and that was why the image was null. Stupid user error! I thought I had checked to make sure everything was good but I guess not. Thanks for the help @username_3.
  
  
  ---
  
  