Skip to content

Commit

Permalink
Don't run the validation if there is no file_obj to run it against
Browse files Browse the repository at this point in the history
  • Loading branch information
jerekshoe committed Apr 25, 2024
1 parent 3116aed commit 37edc0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/evss_claim_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def tracked_item_id=(num)
private

def content_type_matches_extension?
return unless file_obj

true_mime_type = MimeMagic.by_magic(File.open(file_obj.tempfile.path)).to_s

# MimeMagic cannot always determine the mime_type and will sometimes
Expand Down

0 comments on commit 37edc0a

Please sign in to comment.