diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-05 23:25:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-05 23:25:48 +0300 |
commit | b9b47617b1695d6eb1a739fd4c4259d58d5bbb8f (patch) | |
tree | 0645efa4e8fb0d2d3432122596bfba30b07bf6c3 /plugins/TabSRMM | |
parent | 78c41a686c483076e6987c18266236c0b17652a1 (diff) |
code cleaning
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/chat/services.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 768657eb78..bf7853e93f 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -158,24 +158,26 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT void ShowRoom(SESSION_INFO *si)
{
- if (si == NULL)
+ if (si == nullptr)
return;
- if (si->hWnd != NULL) {
+ if (si->hWnd != nullptr) {
ActivateExistingTab(si->dat->m_pContainer, si->hWnd);
return;
}
wchar_t szName[CONTAINER_NAMELEN + 2]; szName[0] = 0;
- TContainerData *pContainer = si->dat->m_pContainer;
- if (pContainer == NULL) {
+ TContainerData *pContainer = nullptr;
+ if (si->dat != nullptr)
+ pContainer = si->dat->m_pContainer;
+ if (pContainer == nullptr) {
GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
if (!g_Settings.bOpenInDefault && !mir_wstrcmp(szName, L"default"))
wcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
szName[CONTAINER_NAMELEN] = 0;
pContainer = FindContainerByName(szName);
}
- if (pContainer == NULL)
+ if (pContainer == nullptr)
pContainer = CreateContainer(szName, FALSE, si->hContact);
if (pContainer)
si->hWnd = CreateNewRoom(pContainer, si, TRUE, TRUE, FALSE);
|