lib/vindetta/validator.rb in vindetta-0.22.0 vs lib/vindetta/validator.rb in vindetta-0.23.0
- old
+ new
@@ -2,9 +2,11 @@
class Validator
def self.vin(vin)
return false unless vin.length == Vindetta::VIN_LENGTH
Calculator.check_digit(vin) == Decoder.vin(vin)[:check_digit]
+ rescue Calculator::InvalidCharacterError
+ false
end
def self.wmi(wmi)
return false unless wmi.length == Vindetta::WMI_LENGTH