diff --git a/lib/protip/transformers/big_decimal_transformer.rb b/lib/protip/transformers/big_decimal_transformer.rb index 48cea1d..e098f86 100644 --- a/lib/protip/transformers/big_decimal_transformer.rb +++ b/lib/protip/transformers/big_decimal_transformer.rb @@ -21,7 +21,7 @@ def to_message(object, field) field.subtype.msgclass.new( numerator: rational.numerator, denominator: rational.denominator, - precision: object.precs[0], # This is the current precision of the decimal + precision: object.try(:precision) || object.precs[0], # This is the current precision of the decimal ) end end).new diff --git a/lib/protip/version.rb b/lib/protip/version.rb index 701f265..f25e4a7 100644 --- a/lib/protip/version.rb +++ b/lib/protip/version.rb @@ -1,3 +1,3 @@ module Protip - VERSION = '0.37.4' + VERSION = '0.37.5' end