Body: <p>When transforming images, we’re getting the following error on the client’s production server.</p>
  <blockquote>
  <p><strong>Internal Server Error</strong></p>
  <p>Argument 1 passed to Craft\AssetTransformsService::ensureTransformUrlByIndexModel() must be an instance of Craft\AssetTransformIndexModel, null given, called in /craft/app/services/ResourcesService.php on line 223 and defined</p>
  </blockquote>
  <p>As a consequence image elements on the page don’t appear. When reloading the page a second time images are displayed as expected.</p>
  <p>What might be the cause of this?</p>
  <hr />
  <p><strong>Edit</strong></p>
  <p>As requested in comments…</p>
  <p>The .htaccess, below-pasted, is just the default.</p>
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
  
      # Send would-be 404 requests to Craft
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
      RewriteRule (.+) index.php?p=$1 [QSA,L]
  &lt;/IfModule&gt;
  </code></pre>
  <p>The template transform is very simple.</p>
  <pre><code>&lt;img src=&quot;{{ block.image.first().getUrl({ width: 560, height: 310 }) }}&quot; alt=&quot;&quot;&gt;
  </code></pre>
  <p>The transform does work but only displays on the second page load.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-25T13:35:38.360Z
Comments.Text: Could please you add your template-code, so we can make sure the issue is not in there.
Comments.UserDisplayName: Victor
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-25T17:09:14.667Z
Comments.Text: Would also like to see your public html .htaccess code as well.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-28T15:29:33.403Z
Comments.Text: Can you enable devMode (http://buildwithcraft.com/docs/config-settings#devMode), reproduce the error and share the full stack trace?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-28T22:24:58.140Z
Comments.Text: I'm about 99% sure this was a bug that has been fixed by the latest release. Are you still seeing it?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-29T14:51:17.803Z
Comments.Text: Thanks, @BradBell. I haven’t got access to that environment to check. Will follow up if it surfaces again.
Comments.UserDisplayName: Joshua Baker
Tags: <assets><image-transforms>
Title: Exception when transforming image
ThreadText: # Exception when transforming image
  
  (Asked by: username_0 on 2014-07-25)
  
  When transforming images, we’re getting the following error on the client’s production server.
  
  > **Internal Server Error**
  >
  > Argument 1 passed to Craft\AssetTransformsService::ensureTransformUrlByIndexModel() must be an instance of Craft\AssetTransformIndexModel, null given, called in /craft/app/services/ResourcesService.php on line 223 and defined
  
  As a consequence image elements on the page don’t appear. When reloading the page a second time images are displayed as expected.
  
  What might be the cause of this?
  
  ---
  
  **Edit**
  
  As requested in comments…
  
  The .htaccess, below-pasted, is just the default.
  
  ```
  <IfModule mod_rewrite.c>
      RewriteEngine On
  
      # Send would-be 404 requests to Craft
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
      RewriteRule (.+) index.php?p=$1 [QSA,L]
  </IfModule>
  
  ```
  
  The template transform is very simple.
  
  ```
  <img src="{{ block.image.first().getUrl({ width: 560, height: 310 }) }}" alt="">
  
  ```
  
  The transform does work but only displays on the second page load.
  
  **Tags:** assets, image-transforms
  
  > **Comments:**
  > **username_1**: Could please you add your template-code, so we can make sure the issue is not in there.  
  > **username_2**: Would also like to see your public html .htaccess code as well.  
  > **username_2**: Can you enable devMode (http://buildwithcraft.com/docs/config-settings#devMode), reproduce the error and share the full stack trace?  
  > **username_2**: I'm about 99% sure this was a bug that has been fixed by the latest release. Are you still seeing it?  
  > **username_0**: Thanks, @username_2. I haven’t got access to that environment to check. Will follow up if it surfaces again.  
  
  ---
  
  ## 0 answers
  
  