diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-19 01:13:01 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-19 19:24:16 +0300 |
commit | c9e483e0fb1566d210530339d13a0e6e91260200 (patch) | |
tree | 92e35cfeef803235fdad89b69968d4b6fd64abdf /protocols/JabberG/src/jabber_adhoc.cpp | |
parent | af9bb538a0609893db7d5f2582595660395f0821 (diff) |
more checks for GetText()
Diffstat (limited to 'protocols/JabberG/src/jabber_adhoc.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_adhoc.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index b19a76e3d5..e9856a685d 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -214,10 +214,10 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, TiXmlElement *workNode // use jabber:x:data form
HWND hFrame = GetDlgItem(hwndDlg, IDC_FRAME);
ShowWindow(GetDlgItem(hwndDlg, IDC_FRAME_TEXT), SW_HIDE);
- if (const char *ptszInstr = xNode->FirstChildElement("instructions")->GetText())
- JabberFormSetInstruction(hwndDlg, ptszInstr);
- else if (const char *ptszTitle = xNode->FirstChildElement("title")->GetText())
- JabberFormSetInstruction(hwndDlg, ptszTitle);
+ if (auto *n = xNode->FirstChildElement("instructions"))
+ JabberFormSetInstruction(hwndDlg, n->GetText());
+ else if (n = xNode->FirstChildElement("title"))
+ JabberFormSetInstruction(hwndDlg, n->GetText());
else
JabberFormSetInstruction(hwndDlg, Translate(status));
JabberFormCreateUI(hFrame, xNode, &dat->CurrentHeight);
@@ -228,8 +228,8 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, TiXmlElement *workNode int toHide[] = { IDC_FRAME_TEXT, IDC_FRAME, IDC_VSCROLL, 0 };
sttShowControls(hwndDlg, FALSE, toHide);
- const char *noteText = commandNode->FirstChildElement("note")->GetText();
- JabberFormSetInstruction(hwndDlg, noteText ? noteText : Translate(status));
+ auto *note = commandNode->FirstChildElement("note");
+ JabberFormSetInstruction(hwndDlg, note ? note->GetText() : Translate(status));
}
// check actions
|