summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-30 12:52:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-30 12:52:26 +0300
commit9e3fcfcb0be82e26ae3d67884815f6f953a4a1d3 (patch)
tree5723ae48a6cab4248af8cdce0941bc71322a28d1 /src
parentf36532694ff709068d7d853cc09423afbdfbbbe6 (diff)
fixes #1231 (Actman: Null pointer in mir_app.mir!CompareProtos)
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/protocols.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp
index 931e83a179..bf7b004359 100644
--- a/src/mir_app/src/protocols.cpp
+++ b/src/mir_app/src/protocols.cpp
@@ -151,6 +151,9 @@ MIR_APP_DLL(int) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd)
MIR_APP_DLL(void) Proto_SetUniqueId(const char *szModuleName, const char *pszUniqueId)
{
+ if (szModuleName == nullptr || pszUniqueId == nullptr)
+ return;
+
PROTOACCOUNT *pa = Proto_GetAccount(szModuleName);
if (pa != nullptr) {
pa->szUniqueId = mir_strdup(pszUniqueId);
@@ -166,6 +169,9 @@ MIR_APP_DLL(void) Proto_SetUniqueId(const char *szModuleName, const char *pszUni
MIR_APP_DLL(const char*) Proto_GetUniqueId(const char *szModuleName)
{
+ if (szModuleName == nullptr)
+ return nullptr;
+
MBaseProto tmp;
PROTOACCOUNT *pa = Proto_GetAccount(szModuleName);
if (pa != nullptr) {