--- a/WinWorkstation.st Mon Oct 22 15:03:13 2018 +0200
+++ b/WinWorkstation.st Mon Oct 22 15:05:08 2018 +0200
@@ -16681,8 +16681,11 @@
%{ /* STACK: 100000 */
if (__isExternalAddress(dataAddress)) {
fileDialogData *pFdd = __externalAddressVal(dataAddress);
- EnumWindows(enumWindowsToFindAndDestroyFileDialogProc, pFdd->fileDialogThreadId);
+ DWORD fileDialogThreadId = pFdd->fileDialogThreadId;
+ if (fileDialogThreadId != 0) {
+ EnumWindows(enumWindowsToFindAndDestroyFileDialogProc, fileDialogThreadId);
+ }
if (__isExternalAddress(threadHandleAddress)) {
HANDLE fileDialogThread = _HWNDVal(threadHandleAddress);
TerminateThread(fileDialogThread, 0);