Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
20 lines
958 B
Diff
20 lines
958 B
Diff
diff --git a/src/service/greetd.ts b/src/service/greetd.ts
|
|
index 10a475e..621a427 100644
|
|
--- a/src/service/greetd.ts
|
|
+++ b/src/service/greetd.ts
|
|
@@ -101,8 +101,12 @@ export class Greetd extends Service {
|
|
ostream.put_int32(json.length, null);
|
|
ostream.put_string(json, null);
|
|
|
|
- const data = await istream.read_bytes_async(4, GLib.PRIORITY_DEFAULT, null);
|
|
- const length = new Uint32Array(data.get_data()?.buffer || [0])[0];
|
|
+ const data = (
|
|
+ await istream.read_bytes_async(4, GLib.PRIORITY_DEFAULT, null)
|
|
+ ).get_data();
|
|
+ const length = data
|
|
+ ? new DataView(data.buffer, data.byteOffset, data.byteLength).getUint32(0, true)
|
|
+ : 0;
|
|
const res = await istream.read_bytes_async(length, GLib.PRIORITY_DEFAULT, null);
|
|
return JSON.parse(this._decoder.decode(res.get_data()!)) as Response;
|
|
} finally {
|