Skip to content

Commit

Permalink
Java: Fix another NPE when dismissing Options dlg
Browse files Browse the repository at this point in the history
<sigh> This is why we can't have nice things.

9d6a396 (exposing keyboarding grabbing
in the GUI) contained a logic error.  Because the || wasn't contained
within parantheses, the last condition-- which dereferenced viewport--
was evaluated even if viewport==null.  No bueno.

Fixes #49
Fixes #66
  • Loading branch information
dcommander committed Sep 21, 2016
1 parent 25b02f6 commit 4336781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ under GNOME 3 with automatic desktop resizing enabled.
20. The Windows TurboVNC Viewer will now pass keystrokes from Microsoft
extended keys to the VNC server when the keyboard is grabbed.

21. Fixed a regression introduced in 2.1 beta1[9] whereby the Linux TurboVNC
Viewer and the Windows Java TurboVNC Viewer would throw a NullPointerException
if the options were changed in the Options dialog prior to connecting to a VNC
server. This issue occurred only in the standalone viewers, not when using
Java Web Start.


2.0.91 (2.1 beta2)
==================
Expand Down
4 changes: 2 additions & 2 deletions java/com/turbovnc/vncviewer/CConn.java
Original file line number Diff line number Diff line change
Expand Up @@ -1551,10 +1551,10 @@ public void getOptions() {
if (VncViewer.osGrab() && Viewport.isHelperAvailable()) {
opts.grabKeyboard = options.grabKeyboard.getSelectedIndex();
if (viewport != null &&
(opts.grabKeyboard == Options.GRAB_ALWAYS &&
((opts.grabKeyboard == Options.GRAB_ALWAYS &&
!viewport.keyboardTempUngrabbed) ||
(opts.grabKeyboard == Options.GRAB_FS &&
opts.fullScreen != viewport.keyboardTempUngrabbed)) {
opts.fullScreen != viewport.keyboardTempUngrabbed))) {
viewport.keyboardTempUngrabbed = !viewport.keyboardTempUngrabbed;
}
}
Expand Down

0 comments on commit 4336781

Please sign in to comment.