Skip to content

Commit

Permalink
Thumbs: guard against derivatives that don't exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Jun 12, 2024
1 parent ec2406a commit 15fc3d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'geoblacklight', '4.4'

# GBL Admin
gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "develop"
gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "guard-nil-derivative"
gem 'git', ">= 1.13"
gem "rubyzip", ">= 1.3.0"
gem "awesome_print"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ GIT

GIT
remote: https://github.com/geobtaa/geoblacklight_admin.git
revision: a2e7919b04d63b3ab45195f26b9dec62bfbfdc24
branch: develop
revision: dc3776c11e0e269e735c0633f340839472aaadc2
branch: guard-nil-derivative
specs:
geoblacklight_admin (0.4.1)
active_storage_validations (~> 1.0)
Expand Down
10 changes: 9 additions & 1 deletion app/views/catalog/_index_mapview_default.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@
<td style="text-align: center;">AWS S3</td>
</tr>
<tr>
<td><%= image_tag document.model.thumbnail.file_url(:thumb_standard_2X) %></td>
<td>
<% if document&.model&.thumbnail&.file_url(:thumb_standard_2X).nil? %>
<span class="icon square mr-3">
<%= geoblacklight_icon(document[Settings.FIELDS.RESOURCE_CLASS]&.first, classes: 'svg_tooltip') %>
</span>
<% else %>
<%= image_tag document&.model&.thumbnail&.file_url(:thumb_standard_2X) %>
<% end %>
</td>
</tr>
</table>
<% end %>
Expand Down

0 comments on commit 15fc3d4

Please sign in to comment.