diff --git a/platform/script-debugger/debugger-ui/src/RemoteVmConnection.kt b/platform/script-debugger/debugger-ui/src/RemoteVmConnection.kt index 9228d5169d1f..9064c576b0be 100644 --- a/platform/script-debugger/debugger-ui/src/RemoteVmConnection.kt +++ b/platform/script-debugger/debugger-ui/src/RemoteVmConnection.kt @@ -45,6 +45,12 @@ abstract class RemoteVmConnection : VmConnection() { @JvmOverloads fun open(address: InetSocketAddress, stopCondition: Condition? = null): Promise { + if (address.isUnresolved) { + val error = "Host ${address.hostString} is unresolved" + setState(ConnectionStatus.CONNECTION_FAILED, error) + return rejectedPromise(error) + } + this.address = address @Suppress("DEPRECATION") port = address.port diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java index fbe57be0afcc..affa659cc3ed 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java @@ -916,8 +916,8 @@ public class XDebugSessionImpl implements XDebugSession { @Override public void stop() { - ProcessHandler processHandler = myDebugProcess.getProcessHandler(); - if (processHandler.isProcessTerminated() || processHandler.isProcessTerminating()) return; + ProcessHandler processHandler = myDebugProcess == null ? null : myDebugProcess.getProcessHandler(); + if (processHandler == null || processHandler.isProcessTerminated() || processHandler.isProcessTerminating()) return; if (processHandler.detachIsDefault()) { processHandler.detachProcess();