Skip to content

Commit

Permalink
fix: undefined filename in livephoto
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
skjnldsv authored and nextcloud-command committed Aug 13, 2024
1 parent ed28d89 commit a401c81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/viewer-main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23140,6 +23140,9 @@ function getDavPath({ filename, basename: basename3, source = "" }) {
);
}
const prefixUser = getUserRoot();
if (!filename || typeof filename !== "string") {
return null;
}
if (source && !source.includes(prefixUser)) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion js/viewer-main.mjs.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/utils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function getDavPath({ filename, basename, source = '' }: { filename: string, bas

const prefixUser = getUserRoot()

if (!filename || typeof filename !== 'string') {
return null
}

// If we have a source but we're not a dav resource, return null
if (source && !source.includes(prefixUser)) {
return null
Expand Down

0 comments on commit a401c81

Please sign in to comment.