File tree 2 files changed +6
-3
lines changed
core/src/main/java/dev/ricknout/rugbyranker/core/api
match/src/main/java/dev/ricknout/rugbyranker/match/data
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ data class Team(
12
12
val abbreviation : String?
13
13
)
14
14
15
+ val tbc = Team (id = - 1L , name = " TBC" , abbreviation = " TBC" )
16
+
15
17
data class Entry (
16
18
val pos : Int ,
17
19
val previousPos : Int ,
@@ -61,7 +63,7 @@ data class Content(
61
63
val venue : Venue ? ,
62
64
val time : Effective ,
63
65
val attendance : Int ,
64
- val teams : List <Team >,
66
+ val teams : List <Team ? >,
65
67
val scores : List <Int >,
66
68
val status : String ,
67
69
val clock : Clock ? ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import dev.ricknout.rugbyranker.core.api.Content
4
4
import dev.ricknout.rugbyranker.core.api.WorldRugbyMatchSummaryResponse
5
5
import dev.ricknout.rugbyranker.core.api.WorldRugbyMatchesResponse
6
6
import dev.ricknout.rugbyranker.core.api.WorldRugbyService
7
+ import dev.ricknout.rugbyranker.core.api.tbc
7
8
import dev.ricknout.rugbyranker.core.model.Sport
8
9
import dev.ricknout.rugbyranker.core.util.DateUtils
9
10
import dev.ricknout.rugbyranker.match.model.Half
@@ -19,8 +20,8 @@ object MatchDataConverter {
19
20
teamIds : List <Long >
20
21
): List <Match > {
21
22
return response.content.map { content ->
22
- val firstTeam = content.teams[0 ]
23
- val secondTeam = content.teams[1 ]
23
+ val firstTeam = content.teams[0 ] ? : tbc
24
+ val secondTeam = content.teams[1 ] ? : tbc
24
25
val event = content.events.firstOrNull()
25
26
Match (
26
27
id = content.matchId,
You can’t perform that action at this time.
0 commit comments