Skip to content

Commit 22fca37

Browse files
committed
fix types
1 parent f706eb5 commit 22fca37

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

apps/sim/app/api/files/upload/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function POST(request: NextRequest) {
7575

7676
for (const file of files) {
7777
const originalName = file.name
78-
if (!originalName || typeof originalName !== 'string') {
78+
if (!originalName) {
7979
throw new InvalidRequestError('File name is missing')
8080
}
8181

apps/sim/app/api/workspaces/[id]/files/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
9494
}
9595

9696
const fileName = rawFile.name
97-
if (!fileName || typeof fileName !== 'string') {
97+
if (!fileName) {
9898
return NextResponse.json({ error: 'File name is missing' }, { status: 400 })
9999
}
100100

apps/sim/executor/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export function isValidEnvVarName(name: string): boolean {
439439
return PATTERNS.ENV_VAR_NAME.test(name)
440440
}
441441

442-
export function sanitizeFileName(fileName: string): string {
442+
export function sanitizeFileName(fileName: string | null | undefined): string {
443443
if (!fileName || typeof fileName !== 'string') {
444444
return 'untitled'
445445
}

0 commit comments

Comments
 (0)