Skip to content

IDBBatchAtomicVFS: Cannot read properties of null (reading 'fileSize') #260

@tetsugi

Description

@tetsugi

When using the IDBBatchAtomicVFS, we encountered a crash in the jFileControl method when handling VFS.SQLITE_FCNTL_SYNC operations.
The issue occurs because file.rollback may be null when accessing file.rollback.fileSize.

case VFS.SQLITE_FCNTL_SYNC:
this.log?.('xFileControl', file.path, 'SYNC');
const commitMetadata = Object.assign({}, file.metadata);
const prevFileSize = file.rollback.fileSize

I suggest adding a null check for file.rollback to prevent crashes.

wa-sqlite version: v1.06
Browser: Chrome 133.0.0, 135.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions