From 0339d8a8cee1a60c9efa4bcc4f23e9b0a1d1a860 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Thu, 27 Feb 2025 22:17:41 +0300
Subject: [PATCH] Update countryTable.ts
---
scripts/tables/countryTable.ts | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/scripts/tables/countryTable.ts b/scripts/tables/countryTable.ts
index 5e167b7fd..06a72490e 100644
--- a/scripts/tables/countryTable.ts
+++ b/scripts/tables/countryTable.ts
@@ -36,15 +36,17 @@ export class CountryTable implements Table {
const subdivision = subdivisions.first(
(subdivision: Subdivision) => subdivision.code === code
)
- const country = countries.first(
- (country: Country) => country.code === subdivision.country
- )
- data.add([
- `${country.name}/${subdivision.name}`,
- ` ${subdivision.name}`,
- logItem.count,
- `https://iptv-org.github.io/iptv/${logItem.filepath}
`
- ])
+ if (subdivision) {
+ const country = countries.first(
+ (country: Country) => country.code === subdivision.country
+ )
+ data.add([
+ `${country.name}/${subdivision.name}`,
+ ` ${subdivision.name}`,
+ logItem.count,
+ `https://iptv-org.github.io/iptv/${logItem.filepath}
`
+ ])
+ }
} else if (countryCode === 'INT') {
data.add([
'ZZ',