Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b26ccc2

Browse files
authored
Slightly more clean and efficient per comments on the PR (#33174)
Code style/efficiency cleanup on HasStrings Windows.
1 parent b5ae8eb commit b26ccc2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

shell/platform/windows/platform_handler_win32.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ void PlatformHandlerWin32::GetHasStrings(
241241
bool hasStrings;
242242
int open_result = clipboard_->Open(std::get<HWND>(*view_->GetRenderTarget()));
243243
if (open_result != kErrorSuccess) {
244-
rapidjson::Document error_code;
245-
error_code.SetInt(open_result);
246244
// Swallow errors of type ERROR_ACCESS_DENIED. These happen when the app is
247245
// not in the foreground and GetHasStrings is irrelevant.
248246
// See https://github.com/flutter/flutter/issues/95817.
249-
if (error_code != kAccessDeniedErrorCode) {
247+
if (open_result != kAccessDeniedErrorCode) {
248+
rapidjson::Document error_code;
249+
error_code.SetInt(open_result);
250250
result->Error(kClipboardError, "Unable to open clipboard", error_code);
251251
return;
252252
}

0 commit comments

Comments
 (0)