Skip to content

Commit ac1d8a1

Browse files
mrjasonroyclaude
andcommitted
fix: handle nullable return type from getDownloadUrl
getDownloadUrl() can return string | null, need to handle null case to fix TypeScript error in build. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent caa283a commit ac1d8a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/ai/tools/file-generator/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ IMPORTANT: After invoking this tool, do NOT include file URLs in your text respo
101101
// Get presigned URL for private buckets if available
102102
let downloadUrl: string;
103103
if (serverFileStorage.getDownloadUrl) {
104-
downloadUrl = await serverFileStorage.getDownloadUrl(uploaded.key);
104+
const presignedUrl = await serverFileStorage.getDownloadUrl(
105+
uploaded.key,
106+
);
107+
downloadUrl = presignedUrl || uploaded.sourceUrl;
105108
logger.info("Presigned URL generated:", {
106109
downloadUrl,
107110
isPresigned: downloadUrl.includes("X-Amz"),

0 commit comments

Comments
 (0)