Skip to content

Commit

Permalink
Updated: Enhance null safety and set default URL in EditMonitor.vue
Browse files Browse the repository at this point in the history
- Added optional chaining to safely access `this.monitor.hostname`.
- Introduced default URL (`https://`) assignment to `this.monitor.url`.
- Ensured `hostname` is trimmed after the URL is set.

Fixes [louislam#5466](louislam#5466)

modified: src/pages/EditMonitor.vue
  • Loading branch information
homelab-alpha committed Dec 26, 2024
1 parent 7f41ef6 commit 7a279a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/EditMonitor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,8 @@ message HealthCheckResponse {
this.monitor.headers = JSON.stringify(JSON.parse(this.monitor.headers), null, 4);
}
if (this.monitor.hostname) {
if (this.monitor?.hostname) {
this.monitor.url = "https://";
this.monitor.hostname = this.monitor.hostname.trim();
}
Expand Down

0 comments on commit 7a279a9

Please sign in to comment.