lib/itax_code/parser.rb in itax_code-1.0.0 vs lib/itax_code/parser.rb in itax_code-1.0.1
- old
+ new
@@ -17,10 +17,10 @@
NoTaxCodeError = Class.new(Error)
InvalidControlInternalNumberError = Class.new(Error)
InvalidTaxCodeError = Class.new(Error)
def initialize(tax_code, utils = Utils.new)
- @tax_code = tax_code.upcase
+ @tax_code = tax_code&.upcase
raise NoTaxCodeError if @tax_code.blank?
raise InvalidTaxCodeError unless Validator.standard_length?(@tax_code)
@utils = utils
raise InvalidControlInternalNumberError if raw[:cin] != @utils.encode_cin(tax_code)