From 4fd01258495411890fa87d564c33265d01b2b064 Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 31 Oct 2017 10:13:26 +0000 Subject: [PATCH] Fixed #1644 --- .../app/settings/sonarr/sonarr.component.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts index a727d9ffc..767b3e445 100644 --- a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts +++ b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts @@ -30,7 +30,6 @@ export class SonarrComponent implements OnInit { private fb: FormBuilder) { } public ngOnInit() { - this.settingsService.getSonarr() .subscribe(x => { this.form = this.fb.group({ @@ -103,10 +102,17 @@ export class SonarrComponent implements OnInit { this.notificationService.error("Please check your entered values"); return; } - if(form.controls.defaultQualityProfile.value === "-1" || form.controls.defaultRootPath.value === "Please Select") { - this.notificationService.error("Please check your entered values"); - return; + if(form.controls.defaultQualityProfile) { + if(form.controls.defaultQualityProfile.value === "-1") { + this.notificationService.error("Please check your entered values"); + } } + if(form.controls.defaultRootPath) { + if(form.controls.defaultRootPath.value === "Please Select") { + this.notificationService.error("Please check your entered values"); + } + } + this.settingsService.saveSonarr(form.value) .subscribe(x => { if (x) {