Bug: empty folder shows "Load failed: Cannot read properties of null (reading 'length')" #71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dogfood finding (Nikola, 2026-07-30): opening an empty folder surfaces
Load failed: Cannot read properties of null (reading 'length')instead of an empty-state.Cause:
GET /api/v1/filesmarshals the driver'sitemsslice, and an empty directory yields a nil slice →"items": nullin JSON, so the client'sitems.lengththrows. (storage.Driver.Listreturnsnil, nilin several drivers rather than an empty slice.)Fix on both sides: server normalises to
[]before writing the response, and the client defends with?? []. Add an empty-state row ("This folder is empty") so a legitimately empty directory renders deliberately rather than as a blank table.Fixed in PR #72, released as v0.3.18, live on the
.249dogfood.Verified on main:
internal/api/api.gonormalises a nil listing to[]storage.FileInfo{}(root cause — an empty directory was marshalling as"items": null), the client defends withdata.items ?? [], and an empty directory now renders the "This folder is empty" state instead of a blank table.(Missed the auto-close because PR #72 named the issues in its title rather than a
Closes #71line.)