Skip to content

Commit 3dd865e

Browse files
authored
Merge pull request #32 from PolyHx/fix/upload-options
Fix to check upload options only if there are options
2 parents 570450e + a6fd39e commit 3dd865e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/database/questions/questions.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ export class QuestionsService {
121121
}
122122

123123
public async uploadFile(file: Express.Multer.File, question: Questions, teamId: string): Promise<boolean> {
124-
if (!question.option.contentTypes.some(x => x.toLowerCase() === file.mimetype.toLowerCase())) {
124+
if (question.option && question.option.contentTypes &&
125+
!question.option.contentTypes.some(x => x.toLowerCase() === file.mimetype.toLowerCase())) {
125126
return false;
126127
}
127128

0 commit comments

Comments
 (0)