From 9995dae4ada133c1333cdceae01afcc4737188e7 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sun, 18 Aug 2024 21:04:02 +1000 Subject: [PATCH] Nil pointer check for DnD (#3597) * Nil pointer check for DnD * Update changelog --- v2/internal/frontend/desktop/windows/frontend.go | 5 +++++ website/src/pages/changelog.mdx | 2 ++ 2 files changed, 7 insertions(+) diff --git a/v2/internal/frontend/desktop/windows/frontend.go b/v2/internal/frontend/desktop/windows/frontend.go index 71e90e8e5..806f4ffba 100644 --- a/v2/internal/frontend/desktop/windows/frontend.go +++ b/v2/internal/frontend/desktop/windows/frontend.go @@ -740,6 +740,11 @@ func (f *Frontend) processMessageWithAdditionalObjects(message string, sender *e return } + if _file == nil { + f.logger.Warning("object at %d is not a file", i) + continue + } + file := (*edge.ICoreWebView2File)(unsafe.Pointer(_file)) defer file.Release() diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 5ef2121eb..368e41030 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed binding for struct fields that were exported but had no json tags. [PR #3678](https://github.com/wailsapp/wails/pull/3678) + Fixed file drop events on Windows in [PR](https://github.com/wailsapp/wails/pull/3595) by @FrancescoLuzzi + Modified `ZoomFactor` and `IsZoomControlEnabled` options to be Windows-only options in PR[#3644](https://github.com/wailsapp/wails/pull/3644) by @levinit +- Added nil check for Drag-n-Drop on Windows. Fixed by in [PR](https://github.com/wailsapp/wails/pull/3597) by @leaanthony based on the suggestion by @Alpa-1 in [#3596](https://github.com/wailsapp/wails/issues/3596). + ## v2.9.1 - 2024-06-18