mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 20:15:22 +02:00
[207785] NPE when trying to send char while no longer connected
This commit is contained in:
parent
02f20b5086
commit
0334a2e1ed
1 changed files with 24 additions and 19 deletions
|
@ -16,6 +16,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [206892] State handling: Only allow connect when CLOSED
|
* Martin Oberhuber (Wind River) - [206892] State handling: Only allow connect when CLOSED
|
||||||
* Martin Oberhuber (Wind River) - [206883] Serial Terminal leaks Jobs
|
* Martin Oberhuber (Wind River) - [206883] Serial Terminal leaks Jobs
|
||||||
* Martin Oberhuber (Wind River) - [208145] Terminal prints garbage after quick disconnect/reconnect
|
* Martin Oberhuber (Wind River) - [208145] Terminal prints garbage after quick disconnect/reconnect
|
||||||
|
* Martin Oberhuber (Wind River) - [207785] NPE when trying to send char while no longer connected
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.emulator;
|
package org.eclipse.tm.internal.terminal.emulator;
|
||||||
|
|
||||||
|
@ -419,7 +420,11 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
protected void sendChar(char chKey, boolean altKeyPressed) {
|
protected void sendChar(char chKey, boolean altKeyPressed) {
|
||||||
try {
|
try {
|
||||||
int byteToSend = chKey;
|
int byteToSend = chKey;
|
||||||
|
OutputStream os = getOutputStream();
|
||||||
|
if (os==null) {
|
||||||
|
// Bug 207785: NPE when trying to send char while no longer connected
|
||||||
|
Logger.log("NOT sending '" + byteToSend + "' because no longer connected"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
} else {
|
||||||
if (altKeyPressed) {
|
if (altKeyPressed) {
|
||||||
// When the ALT key is pressed at the same time that a character is
|
// When the ALT key is pressed at the same time that a character is
|
||||||
// typed, translate it into an ESCAPE followed by the character. The
|
// typed, translate it into an ESCAPE followed by the character. The
|
||||||
|
@ -438,8 +443,8 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
Logger.log("sending '" + byteToSend + "'"); //$NON-NLS-1$ //$NON-NLS-2$
|
Logger.log("sending '" + byteToSend + "'"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
getOutputStream().write(byteToSend);
|
getOutputStream().write(byteToSend);
|
||||||
}
|
}
|
||||||
|
|
||||||
getOutputStream().flush();
|
getOutputStream().flush();
|
||||||
|
}
|
||||||
} catch (SocketException socketException) {
|
} catch (SocketException socketException) {
|
||||||
Logger.logException(socketException);
|
Logger.logException(socketException);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue