mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-08 14:30:18 +00:00
Fix for NPE the first time you create a new image and try to draw -- the state management was setting a null when there was no previous state
This commit is contained in:
parent
6e2187087f
commit
7ac3f974b9
@ -100,7 +100,12 @@ public class AppleImageEditor extends ImageEditor implements EventHandler<MouseE
|
||||
public void setState(EnumMap oldState) {
|
||||
state.putAll(oldState);
|
||||
changeCurrentPattern((FillPattern) state.get(StateVars.PATTERN));
|
||||
_setDrawMode((DrawMode) state.get(StateVars.DRAW_MODE));
|
||||
DrawMode oldDrawMode = (DrawMode) state.get(StateVars.DRAW_MODE);
|
||||
if (oldDrawMode != null) {
|
||||
_setDrawMode(oldDrawMode);
|
||||
} else {
|
||||
state.put(StateVars.DRAW_MODE, currentDrawMode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user