From b9b47617b1695d6eb1a739fd4c4259d58d5bbb8f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 5 Mar 2017 23:25:48 +0300 Subject: code cleaning --- plugins/TabSRMM/src/chat/services.cpp | 12 +++++++----- 1 file 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); -- cgit v1.2.3