From af0af476df1eba08312a5fd03c9fd6fce2fe6c37 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Fri, 6 May 2022 10:43:32 -0700 Subject: [PATCH] Slightly more clean and efficient per comments on the PR --- shell/platform/windows/platform_handler_win32.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/platform/windows/platform_handler_win32.cc b/shell/platform/windows/platform_handler_win32.cc index dac80a0e5a9b5..93d391a8f8f94 100644 --- a/shell/platform/windows/platform_handler_win32.cc +++ b/shell/platform/windows/platform_handler_win32.cc @@ -241,12 +241,12 @@ void PlatformHandlerWin32::GetHasStrings( bool hasStrings; int open_result = clipboard_->Open(std::get(*view_->GetRenderTarget())); if (open_result != kErrorSuccess) { - rapidjson::Document error_code; - error_code.SetInt(open_result); // Swallow errors of type ERROR_ACCESS_DENIED. These happen when the app is // not in the foreground and GetHasStrings is irrelevant. // See https://github.com/flutter/flutter/issues/95817. - if (error_code != kAccessDeniedErrorCode) { + if (open_result != kAccessDeniedErrorCode) { + rapidjson::Document error_code; + error_code.SetInt(open_result); result->Error(kClipboardError, "Unable to open clipboard", error_code); return; }