Ruby exception occured `+'

Hi guys

Got strange exception because the result is correct, but then all the code after the one who caused the exception is not working anymore. Here is the code :

event.set( '[ln_resistance_B_inversion]', ( event.get('[ln_payload_decoded]')[72..73] + event.get('[ln_payload_decoded]')[70..71] ) )
event.set( '[ln_resistance]', [event.get('[ln_resistance_B_inversion]')].pack('H*').unpack('g').first )
event.set( '[ln_temperature_B_inversion]', ( event.get('[ln_payload_decoded]')[52..53] + event.get('[ln_payload_decoded]')[50..51] ) )
event.set( '[ln_temperature]', [event.get('[ln_temperature_B_inversion]')].pack('H*').unpack('g').first )

Then the error that I have is the following :

exception occurred: undefined method `+' for nil:NilClass

I have the correct value for ln_resistance_B_inversion and ln_resistance but not for the others after

Thanks in advanced

Show an example of an event that results in this error. Use a stdout { codec => rubydebug } output.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.