Skip to content

Commit

Permalink
fix: tags field may be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzocorallo committed Feb 12, 2024
1 parent b3fee17 commit ec89d21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Util/Question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function Question({
)
})}

{q.tags.length > 0 && (
{q.tags && q.tags.length > 0 && (
<div style={styles.tagsContainer}>
<FaAnchor />
<p style={styles.tags}>{concatTags(q.tags)}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Question {
correct: AnswerLetter
attachments: string[]
validated: boolean
tags: string[]
tags?: string[]

// These are only present for COM questions
sub?: string
Expand Down

0 comments on commit ec89d21

Please sign in to comment.