#82 fix NPE in TTerminalWidget:spawnShell()

This commit is contained in:
Autumn Lamonte 2021-12-19 12:14:25 -06:00
parent fcc8209517
commit b2c901981c
2 changed files with 11 additions and 4 deletions

View file

@ -48,8 +48,15 @@ public class JexerTilingWindowManager2 extends TApplication {
// Let's also suppress the status line.
System.setProperty("jexer.hideStatusBar", "true");
JexerTilingWindowManager2 jtwm = new JexerTilingWindowManager2();
final JexerTilingWindowManager2 jtwm = new JexerTilingWindowManager2();
(new Thread(jtwm)).start();
jtwm.invokeLater(new Runnable() {
public void run() {
// Spin up the root terminal
jtwm.createRootTerminal();
}
});
}
/**
@ -92,8 +99,6 @@ public class JexerTilingWindowManager2 extends TApplication {
}
});
// Spin up the root terminal
createRootTerminal();
}
/**

View file

@ -1000,7 +1000,9 @@ public class TTerminalWidget extends TScrollableWidget
try {
int scrollbackMax = Integer.parseInt(System.getProperty(
"jexer.TTerminal.scrollbackMax", "2000"));
emulator.setScrollbackMax(scrollbackMax);
if (emulator != null) {
emulator.setScrollbackMax(scrollbackMax);
}
} catch (NumberFormatException e) {
// SQUASH
}