From 3b39a0dc449bcc456bf6c99fbf6a1d93fb33f63c Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 21 Jun 2023 00:30:34 +0800 Subject: [PATCH] remove one warn --- flutter/lib/common.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 4bc92d41d..5445bf2f0 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1332,7 +1332,13 @@ Future saveWindowPosition(WindowType type, {int? windowId}) async { break; default: final wc = WindowController.fromWindowId(windowId!); - final frame = await wc.getFrame(); + final Rect frame; + try { + frame = await wc.getFrame(); + } catch (e) { + debugPrint("Failed to get frame of window $windowId, it may be hidden"); + return; + } final position = frame.topLeft; final sz = frame.size; final isMaximized = await wc.isMaximized();