Merge pull request #2265 from TheMas3212/fix-2119

Fix 2119
This commit is contained in:
hydroflame 2022-01-08 13:56:05 -05:00 committed by GitHub
commit 7633f271db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -121,6 +121,16 @@ export function Root(props: IProps): React.ReactElement {
vim: props.vim || Settings.MonacoVim, vim: props.vim || Settings.MonacoVim,
}); });
// Prevent Crash if script is open on deleted server
openScripts = openScripts.filter((script) => {
return GetServer(script.hostname) !== null;
})
if (currentScript && (GetServer(currentScript.hostname) === null)) {
currentScript = openScripts[0];
if (currentScript === undefined) currentScript = null;
}
const [dimensions, setDimensions] = useState({ const [dimensions, setDimensions] = useState({
height: window.innerHeight, height: window.innerHeight,
width: window.innerWidth, width: window.innerWidth,