mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
Fix possible NPE in MonitoringGuacamoleReader read() and readInstruction().
This commit is contained in:
@@ -66,13 +66,23 @@ public class MonitoringGuacamoleReader implements GuacamoleReader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char[] read() throws GuacamoleException {
|
public char[] read() throws GuacamoleException {
|
||||||
return readInstruction().toString().toCharArray();
|
|
||||||
|
// Read single instruction, handle end-of-stream
|
||||||
|
GuacamoleInstruction instruction = readInstruction();
|
||||||
|
if (instruction == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return instruction.toString().toCharArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GuacamoleInstruction readInstruction() throws GuacamoleException {
|
public GuacamoleInstruction readInstruction() throws GuacamoleException {
|
||||||
|
|
||||||
|
// Read single instruction, handle end-of-stream
|
||||||
GuacamoleInstruction instruction = reader.readInstruction();
|
GuacamoleInstruction instruction = reader.readInstruction();
|
||||||
|
if (instruction == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
// If clipboard changed, notify listeners
|
// If clipboard changed, notify listeners
|
||||||
if (instruction.getOpcode().equals("clipboard")) {
|
if (instruction.getOpcode().equals("clipboard")) {
|
||||||
|
Reference in New Issue
Block a user