We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdb45fe commit f9f3fd7Copy full SHA for f9f3fd7
1 file changed
packages/center/index.ts
@@ -13,6 +13,14 @@ function decrypt(encrypted: string) {
13
).toString(crypto.enc.Utf8);
14
}
15
16
+const safeLt = (a: string, b: string) => {
17
+ try {
18
+ return lt(a, b);
19
+ } catch (e) {
20
+ return false;
21
+ }
22
+};
23
+
24
declare module 'hydrooj' {
25
interface Collections {
26
dataReport: any;
@@ -64,7 +72,7 @@ class DataReportHandler extends Handler {
64
72
dbVersion: payload.dbVersion,
65
73
};
66
74
if (old?.notification) setPayload.notification = '';
67
- if (old && lt(payload.version, old.version)) {
75
+ if (old && safeLt(payload.version, old.version)) {
68
76
await coll.updateOne(
69
77
{ _id: installId },
70
78
{
0 commit comments