Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 7f47dbc

Browse files
author
Paul Von Schrottky
committed
Fix subscriber fetch new sites
1 parent 8e020f8 commit 7f47dbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/WordPressKit/Models/Stats/StatsSubscribersSummaryData.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ extension StatsSubscribersSummaryData: StatsTimeIntervalData {
5555
let history: [SubscriberData?] = data.map { elements in
5656
guard elements.indices.contains(dateIndex) && elements.indices.contains(countIndex),
5757
let dateString = elements[dateIndex] as? String,
58-
let date = StatsSubscribersSummaryData.parsedDate(from: dateString, for: period),
59-
let count = elements[countIndex] as? Int
58+
let date = StatsSubscribersSummaryData.parsedDate(from: dateString, for: period)
6059
else {
6160
return nil
6261
}
6362

63+
let count = elements[countIndex] as? Int ?? 0
64+
6465
return SubscriberData(date: date, count: count)
6566
}
6667

0 commit comments

Comments
 (0)