Skip to content

Commit

Permalink
Fix exception when no URL yet
Browse files Browse the repository at this point in the history
toURL() will throw if the string is blank, which it will be on the very
first time Gateway is launched.
  • Loading branch information
code-asher committed Apr 30, 2024
1 parent 117fd54 commit 1ba25ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ class CoderWorkspacesStepView : CoderWizardStep<CoderWorkspacesStepSelection>(
* 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) {
Expand All @@ -518,7 +518,7 @@ class CoderWorkspacesStepView : CoderWizardStep<CoderWorkspacesStepSelection>(
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,
Expand Down

0 comments on commit 1ba25ce

Please sign in to comment.