Skip to content

Commit 97dadd8

Browse files
authored
Merge pull request #1392 from gdg-x/tags
Support empty tag arrays
2 parents 5a36425 + 8c706ee commit 97dadd8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

functions/src/schedule-generator/speakers-sessions-map.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export function sessionsSpeakersMap(sessionsRaw, speakersRaw) {
66
const sessionId = Object.keys(sessionsRaw)[index];
77
const currentSession = sessionsRaw[sessionId];
88
const sessionSpeakers = [];
9-
const mainTag = currentSession.tags ? currentSession.tags[0] : 'General';
9+
const mainTag =
10+
currentSession.tags && currentSession.tags.length ? currentSession.tags[0] : 'General';
1011

1112
currentSession.speakers &&
1213
currentSession.speakers.forEach((speakerId) => {

functions/src/schedule-generator/speakers-sessions-schedule-map.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export function sessionsSpeakersScheduleMap(sessionsRaw, speakersRaw, scheduleRa
2424
for (let subSessionIndex = 0; subSessionIndex < subSessionsLen; subSessionIndex++) {
2525
const sessionId = timeslot.sessions[sessionIndex].items[subSessionIndex];
2626
const subsession = sessionsRaw[sessionId];
27-
const mainTag = subsession.tags ? subsession.tags[0] : 'General';
27+
const mainTag =
28+
subsession.tags && subsession.tags.length ? subsession.tags[0] : 'General';
2829
const endTimeRaw = timeslot.sessions[sessionIndex].extend
2930
? day.timeslots[timeslotsIndex + timeslot.sessions[sessionIndex].extend - 1].endTime
3031
: timeslot.endTime;

0 commit comments

Comments
 (0)