Skip to content

Wrong status code returned for sketch/file that does not exist #1264

@thegitone23

Description

@thegitone23

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: Firefox
  • Operating System: Linux
  • Steps to reproduce this bug:
    Go to https://editor.p5js.org/sketches/any_id/assets/any_file and 502 is returned.
    The problem is caused by the fact that the function getFileContent which is supposed to handle this route isn't verifying whether the returned object from database is null or not and it's also not checking for undefined asset name.

Because the sketch/file does not exist, a 404 error should be returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions