From ac78962bd437c31cc7d62b88a48e32fa3bc3d0a5 Mon Sep 17 00:00:00 2001 From: 4gray <4gray@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:58:44 +0200 Subject: [PATCH] refactor: improve error handling --- src/app/services/epg.service.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/services/epg.service.ts b/src/app/services/epg.service.ts index 38ebe2d18..e45b678a8 100644 --- a/src/app/services/epg.service.ts +++ b/src/app/services/epg.service.ts @@ -31,12 +31,14 @@ export class EpgService { if (!Array.isArray(urls)) { urls = [urls]; } - urls.forEach((url) => - this.electronService.sendIpcEvent(EPG_FETCH, { - url, - }) - ); - this.showFetchSnackbar(); + if (urls?.length > 0) { + urls.forEach((url) => + this.electronService.sendIpcEvent(EPG_FETCH, { + url, + }) + ); + this.showFetchSnackbar(); + } } showFetchSnackbar() {