Move handleEvent var declaration _after_ handleEventDefault val declaration. Using a val before defining it causes nullpointer exceptions...
This commit is contained in:
parent
31da5b9947
commit
aee972f5c7
1 changed files with 1 additions and 1 deletions
|
|
@ -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), _, _) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue