String Variable error - invoke method

Could anyone tell me why this doesn’t work in my rule:

var String CurrentSunset
CurrentSunset = IsSunset.state

2017-04-13 20:58:31.819 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘Run Tests’: An error occured during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.StringExtensions.operator_plus(java.lang.String,java.lang.String) on instance: null

Thanks

@milty456 I believe it should be:
CurrentSunset = IsSunset.state.toString

Thanks…that worked…curiously…not sure why the original didn’t.
I have another rule that works fine now that does this and works fine…weird; i would have expected this to fail as well

var String LastTimeOn
var String LastTimeOff

LastTimeOff = “” + now.getMonthOfYear + “/” + now.getDayOfMonth + " | " + now.getHourOfDay + “:” + now.getMinuteOfHour
postUpdate(EcoBeeLastTimeOff, LastTimeOff)
sendMail("testxx@gmail.com", "HVAC Switched Off: " + LastTimeOff + “”, "HVAC Switched off at: " + LastTimeOff)

you are doing an implicit conversion to String in line:

LastTimeOff = "" + now.getMonthOfYear + "/" + now.getDayOfMonth + " | " + now.getHourOfDay + ":" + now.getMinuteOfHour