Skip to content

Commit 91db3f9

Browse files
authored
fix: prevent potential crashes
1 parent a6001ee commit 91db3f9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/armory/DataTablesSsp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export class DataTablesSsp {
7171
this.length = Math.min(100, Math.max(0, parseInt(query.length as string, 10)));
7272
this.draw = parseInt(query.draw as string, 10);
7373
this._order = (query.order as { column: string; dir: string }[]).map((order) => {
74-
return { column: parseInt(order.column, 10), dir: order.dir };
74+
const dir = order.dir.toUpperCase() === "DESC" ? "DESC" : "ASC";
75+
return { column: parseInt(order.column, 10), dir };
7576
});
7677
this.columns = (
7778
query.columns as { data: string; name: string; searchable: string; orderable: string; search: { value: string; regex: string } }[]

0 commit comments

Comments
 (0)