Skip to content

Commit

Permalink
[desktop_drop] fix windows build warning C4701: potentially uninitial…
Browse files Browse the repository at this point in the history
…ized local variable 'hwnd' (#279)
  • Loading branch information
boyan01 committed Aug 25, 2023
1 parent 1f24027 commit 095a376
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/desktop_drop/windows/desktop_drop_plugin.cpp
Expand Up @@ -138,11 +138,16 @@ namespace {
registrar->messenger(), "desktop_drop",
&flutter::StandardMethodCodec::GetInstance());

HWND hwnd;
HWND hwnd = nullptr;
if (registrar->GetView()) {
hwnd = registrar->GetView()->GetNativeWindow();
}

if (hwnd == nullptr) {
// no window, no drop.
return;
}

channel->SetMethodCallHandler([](const auto &call, auto result) {
result->NotImplemented();
});
Expand Down

0 comments on commit 095a376

Please sign in to comment.