diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2020-12-08 16:44:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 16:44:45 +0300 |
commit | 4de48da971eba817053f0994c1fffab511bb4473 (patch) | |
tree | 69fd10d64e19f01e407cf443f75f7252f260a136 /src/utils/fileUtils.js | |
parent | 060c54e4ac33a705837e7a282786362cd66fadc1 (diff) | |
parent | c2624fbb1aefca117bab3547f136bd24cc54a132 (diff) |
Merge pull request #584 from nextcloud/backport/581/stable19v19.0.6
[stable19] Make sure we have a string to localecompare to
Diffstat (limited to 'src/utils/fileUtils.js')
-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) { |