diff --git a/CHANGELOG.md b/CHANGELOG.md index a9729792..76f614b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Default URL setting was showing the help text for the setup command instead of its own description. +- Exception when there is no default or last used URL. ## 2.11.2 - 2024-04-30 diff --git a/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt b/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt index a546d4f3..1c1e4199 100644 --- a/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt +++ b/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt @@ -509,7 +509,7 @@ class CoderWorkspacesStepView : CoderWizardStep( * unless retry is false. */ private fun maybeAskTokenThenConnect(isRetry: Boolean = false) { - val oldURL = fields.coderURL.toURL() + val oldURL = fields.coderURL component.apply() // Force bindings to be filled. val newURL = fields.coderURL.toURL() if (settings.requireTokenAuth) { @@ -518,7 +518,7 @@ class CoderWorkspacesStepView : CoderWizardStep( newURL, // If this is a new URL there is no point in trying to use the same // token. - if (oldURL.toString() == newURL.toString()) fields.token else null, + if (oldURL == newURL.toString()) fields.token else null, isRetry, fields.useExistingToken, settings,