summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-25 21:53:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-25 21:53:55 +0300
commit91b53db66b594868e9bee6d098579eb3e2f85e12 (patch)
tree64936216e0c5ab71497fee5e097608e671653cd7 /src/core
parentd6f99a48a6855e8ebc860d069b4c61adbd168f90 (diff)
StdFile: fix for file recv dialog not closing
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index 540ac478ca..760633e225 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -335,9 +335,6 @@ public:
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
- if (dat == nullptr)
- return 0;
-
switch (msg) {
case WM_COMMAND:
if (Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, dat->hContact))
@@ -346,19 +343,21 @@ public:
case HM_RECVEVENT:
ACKDATA *ack = (ACKDATA *)lParam;
- if (!ack || (ack->hProcess != dat->fs) || (ack->type != ACKTYPE_FILE) || (ack->hContact != dat->hContact))
- break;
-
- if (ack->result == ACKRESULT_DENIED || ack->result == ACKRESULT_FAILED) {
- EnableWindow(GetDlgItem(m_hwnd, IDOK), FALSE);
- EnableWindow(GetDlgItem(m_hwnd, IDC_FILEDIR), FALSE);
- EnableWindow(GetDlgItem(m_hwnd, IDC_FILEDIRBROWSE), FALSE);
- SetDlgItemText(m_hwnd, IDC_MSG, TranslateT("This file transfer has been canceled by the other side"));
- Skin_PlaySound("FileDenied");
- FlashWindow(m_hwnd, TRUE);
- }
- else if (ack->result != ACKRESULT_FILERESUME) {
- btnCancel.Click();
+ if (ack && dat) {
+ if (ack->hProcess != dat->fs || ack->type != ACKTYPE_FILE || ack->hContact != dat->hContact)
+ break;
+
+ if (ack->result == ACKRESULT_DENIED || ack->result == ACKRESULT_FAILED) {
+ EnableWindow(GetDlgItem(m_hwnd, IDOK), FALSE);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_FILEDIR), FALSE);
+ EnableWindow(GetDlgItem(m_hwnd, IDC_FILEDIRBROWSE), FALSE);
+ SetDlgItemText(m_hwnd, IDC_MSG, TranslateT("This file transfer has been canceled by the other side"));
+ Skin_PlaySound("FileDenied");
+ FlashWindow(m_hwnd, TRUE);
+ }
+ else if (ack->result != ACKRESULT_FILERESUME) {
+ btnCancel.Click();
+ }
}
break;
}