Move handleEvent var declaration _after_ handleEventDefault val declaration. Using a val before defining it causes nullpointer exceptions...

This commit is contained in:
momania 2011-01-03 19:37:23 +01:00
parent 31da5b9947
commit aee972f5c7

View file

@ -288,12 +288,12 @@ trait FSM[S, D] {
}
}
private var handleEvent: StateFunction = handleEventDefault
private val handleEventDefault: StateFunction = {
case Event(value, stateData) =>
log.slf4j.warn("Event {} not handled in state {}, staying at current state", value, currentState.stateName)
stay
}
private var handleEvent: StateFunction = handleEventDefault
private var terminateEvent: PartialFunction[StopEvent[S,D], Unit] = {
case StopEvent(Failure(cause), _, _) =>