Skip to content

DatabaseBackend::get is a panic waiting to happen #1066

Closed
@jyn514

Description

@jyn514

(CASE WHEN LENGTH(content) <= $2 THEN content ELSE NULL END) AS content,
returns NULL if the file is too big. But blob.content is a Vec, not an Option<Vec>. So
content: row.get("content"),
will panic whenever the content is NULL.

Fortunately, the database backend isn't used in prod, but this is something to be aware of when self-hosting or running tests.

This was caught while working on #874.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bugP-lowLow priority issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions