From 8693fab66c848c205d794b25605a4abd01787337 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sat, 2 Jan 2021 19:04:51 +0100 Subject: [PATCH] fix build errors --- src/dialog.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dialog.ts b/src/dialog.ts index a9fba72..4b23073 100644 --- a/src/dialog.ts +++ b/src/dialog.ts @@ -1,6 +1,5 @@ import { ChildProcessWithoutNullStreams, spawn } from "child_process"; import { EventEmitter } from "events"; -import { promisify } from "util"; import simpleSpawn from "./simple-spawn"; import sleep from "./sleep"; @@ -142,7 +141,11 @@ export default class Dialog extends EventEmitter { "node-zenity", ]); // to activate it if (last_position) { - const { width, height } = await get_geometry(); + const geometry = await get_geometry(); + if (!geometry) { + continue; + } + const { width, height } = geometry; console.log(last_position, width, height); await set_geometry({ x: last_position.x - width / 2 - 11,