<commit_before>module Paperclip
  class Cropper < Thumbnail
    def transformation_command
      return super if super.join(" ").include?(Spree::Image.attachment_definitions[:attachment][:styles][:crop])
      if crop_command
        crop_command + super.join(" ").sub(/ -crop \S+/, '')
      else
        super
      end
    end

    def crop_command
      target = @attachment.instance
      if target.cropping?
        " -crop #{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i} "
      end<commit_msg>nil guard added.<commit_after>module Paperclip
  class Cropper < Thumbnail
    def transformation_command

      spr_cmd = super.join(" ")

      return super if spr_cmd.present? and spr_cmd.include?(Spree::Image.attachment_definitions[:attachment][:styles][:crop])
      if crop_command
        crop_command + super.join(" ").sub(/ -crop \S+/, '')
      else
        super
      end
    end

    def crop_command
      target = @attachment.instance
      if target.cropping?
        " -crop #{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i} "
      end
{'fraction_non_alphanumeric': 0.13074204946996468, 'fraction_numerical': 0.0, 'mean_word_length': 2.8537414965986394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7641287', 'n_tokens_mistral': 383, 'n_tokens_neox': 386, 'n_words': 68}