fix: (regression beta) get-list not working on root

Massimo Melina committed Mar 9, 2025 at 17:13 UTC beda6c9c7ea3471801e22b05f4fd97a40999968b
1 file changed +1 -1
frontend/src/state.ts
+1 -1
@@ -118,7 +118,7 @@ export class DirEntry implements ServerDirEntry {
118 n = n.slice(0, -1)
119 Object.assign(this, rest) // we actually allow any custom property to be memorized
120 this.n = n // must do it after 'rest' to avoid overwriting
121 - this.uri = rest?.url || ((n[0] === '/' ? '' : location.pathname) + pathEncode(n) + (this.isFolder ? '/' : ''))
121 + this.uri = rest?.url || ((!n || n[0] === '/' ? '' : location.pathname) + pathEncode(n) + (this.isFolder ? '/' : ''))
122 if (!this.isFolder) {
123 const i = n.lastIndexOf('.') + 1
124 this.ext = i ? n.substring(i).toLowerCase() : ''