diff --git a/tauri/src/platform/filesystem.ts b/tauri/src/platform/filesystem.ts index fc5083b9..2292a99a 100644 --- a/tauri/src/platform/filesystem.ts +++ b/tauri/src/platform/filesystem.ts @@ -10,12 +10,12 @@ export const tauriFilesystem: PlatformFilesystem = { }); if (filePath) { - const resolvedPath = - typeof filePath === 'string' - ? filePath - : filePath && typeof filePath === 'object' && 'path' in filePath - ? (filePath as { path: string }).path - : ''; + let resolvedPath = ''; + if (typeof filePath === 'string') { + resolvedPath = filePath; + } else if (filePath && typeof filePath === 'object' && 'path' in filePath) { + resolvedPath = (filePath as { path: string }).path; + } if (!resolvedPath) { throw new Error('Failed to resolve save path');