diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-12-07 17:45:39 +0300 |
---|---|---|
committer | npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com> | 2020-12-08 14:28:42 +0300 |
commit | a794083e4347cd744f6cc0aa48290c8cf0d6ed96 (patch) | |
tree | 7ed0863d15feafefd6abe96ba6e7fc4ec28a5a8b /src | |
parent | 9bfd4afd5b295a8f4fed8a37361881151f056f5a (diff) |
Make sure we have a string to localecompare to
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/fileUtils.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/fileUtils.js b/src/utils/fileUtils.js index 50e6168d..e8a931c0 100644 --- a/src/utils/fileUtils.js +++ b/src/utils/fileUtils.js @@ -93,8 +93,8 @@ const sortCompare = function(fileInfo1, fileInfo2, key, asc = true) { // finally sort by name return asc - ? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage()) - : -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage()) + ? fileInfo1[key]?.localeCompare(fileInfo2[key], OC.getLanguage()) || 1 + : -fileInfo1[key]?.localeCompare(fileInfo2[key], OC.getLanguage()) || -1 } const genFileInfo = function(obj) { |