- // If the emulator is tracking mouse buttons, it needs to see wheel
- // events.
- if (emulator.getMouseProtocol() == ECMA48.MouseProtocol.OFF) {
- if (mouse.isMouseWheelUp()) {
- verticalDecrement();
- dirty = true;
- return;
+ if (emulator != null) {
+ // If the emulator is tracking mouse buttons, it needs to see
+ // wheel events.
+ if (emulator.getMouseProtocol() == ECMA48.MouseProtocol.OFF) {
+ if (mouse.isMouseWheelUp()) {
+ verticalDecrement();
+ dirty = true;
+ return;
+ }
+ if (mouse.isMouseWheelDown()) {
+ verticalIncrement();
+ dirty = true;
+ return;
+ }