diff options
| author | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2025-12-07 00:51:13 +0000 |
|---|---|---|
| committer | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2025-12-07 00:51:13 +0000 |
| commit | 6dbedb038a152a22dd9ee4b04a41a8b3ffde5d1f (patch) | |
| tree | 318bf307ad47c17af3a44d1dbd8326d04f4614ee | |
| parent | 68118cb83c6993eae0f46d92ea29861bf5d7679c (diff) | |
| download | slskd-6dbedb038a152a22dd9ee4b04a41a8b3ffde5d1f.tar.gz | |
Handle null/undefined dates in sorting logic
Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com>
| -rw-r--r-- | src/web/src/components/System/Files/Explorer.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/web/src/components/System/Files/Explorer.jsx b/src/web/src/components/System/Files/Explorer.jsx index 543c0744..ca0bdba1 100644 --- a/src/web/src/components/System/Files/Explorer.jsx +++ b/src/web/src/components/System/Files/Explorer.jsx @@ -180,8 +180,8 @@ const Explorer = ({ remoteFileManagement, root }) => { sensitivity: 'base', }); } else if (sortColumn === 'date') { - const dateA = new Date(a.modifiedAt); - const dateB = new Date(b.modifiedAt); + const dateA = a.modifiedAt ? new Date(a.modifiedAt) : new Date(0); + const dateB = b.modifiedAt ? new Date(b.modifiedAt) : new Date(0); compareValue = dateA - dateB; } |
