Issues with between

I am using the following ruby code but getting an exception about "ruby exception undefined method between? for nil:Nilclass"?

event.set("[weekInMonth]", 2) if event.get("[tempDay]").between?(8, 15)

What should I change this to? I am trying to use this for multiple things.

That suggests that some events do not have a tempDay field.

Is there any way to modify the ruby so it does not give the error. For example, if nil then skip.

code => '
    t = event.get("[tempDay]")
    if t
        event.set("[weekInMonth]", 2) if t.between?(8, 15)

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