Project

General

Profile

Bug #8300

NPE in ChUI mode when ESC is pressed.

Added by Vladimir Tsichevski 2 months ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#1 Updated by Vladimir Tsichevski 2 months ago

When the user presses Escape button, the following code is executed in LinuxKeyboardReader.keyPressed():

     // escape is never returned as 27, instead it sets some state as a
      // modifier key
      if (key == KeyEvent.VK_ESCAPE)
      {
         // toggle the flag
         escPressed = !escPressed;

         queue.add(null);
                   ^^^^
         return;
      }

The LinkedBlockingQueue does not accept null value as the item, to the call queue.add(null) causes explicitly thrown NPE:

    public boolean offer(E e) {
        if (e == null) throw new NullPointerException();

The java.awt.EventDispatchThread catches, logs and ignores the exception, so no client crash happens due to it.

But the FWD code after the call are not executed due to this exception, this result in that the next keyboard command is interpreted in some unexpected way.

Also available in: Atom PDF