<%#
# Carrierwave Show Partial

This partial renders a summary of the current attachment(s)
for this attribute

## Local variables:

- `field`:
  An instance of Administrate::Field::Carrierwave.
  A wrapper around the attribute pulled from the database.
%>

<% if field.multiple? %>
  <% if field.files.any? %>
    <ul>
      <%- field.files.each do |file| %>
        <li><%= render 'fields/carrierwave/file', file: file %></li>
      <% end %>
    </ul>
  <% else %>
    <span>No file(s) uploaded yet</span>
  <% end %>
<% else %>
  <% if field.image.present? && field.data.model.persisted? && field.file.version_exists?(field.image) %>
    <%= render 'fields/carrierwave/preview', file: field.file, field: field %>
  <% elsif field.file.present? %>
    <%= render 'fields/carrierwave/file', file: field.file %>
  <% else %>
      -
  <% end %>
<% end %>

<%#
# Carrierwave Show Partial

This partial renders a summary of the current attachment(s)
for this attribute

## Local variables:

- `field`:
  An instance of Administrate::Field::Carrierwave.
  A wrapper around the attribute pulled from the database.
%>

<% if field.multiple? %>
  <% if field.files.any? %>
    <ul>
      <%- field.files.each do |file| %>
        <li><%= render 'fields/carrierwave/file', file: file %></li>
      <% end %>
    </ul>
  <% else %>
    <span>No file(s) uploaded yet</span>
  <% end %>
<% else %>
  <% if field.image.present? && field.data.model.persisted? && field.data.file.present? %>
    <%= render 'fields/carrierwave/preview', file: field.file, field: field %>
  <% elsif field.file.present? %>
    <%= render 'fields/carrierwave/file', file: field.file %>
  <% else %>
      -
  <% end %>
<% end %>

Fix the crash that happens when no uploaded image exists
Fix the crash that happens when no uploaded image exists
