From bc62befe65f4ff950bb192d703fb38a9336d5a51 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 27 May 2012 19:53:42 +0000 Subject: NewXstatusNotify crash fix (patch wishmaster) git-svn-id: http://svn.miranda-ng.org/main/trunk@200 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewXstatusNotify/options.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins/NewXstatusNotify') diff --git a/plugins/NewXstatusNotify/options.cpp b/plugins/NewXstatusNotify/options.cpp index 51cc48e432..f78ff9ea04 100644 --- a/plugins/NewXstatusNotify/options.cpp +++ b/plugins/NewXstatusNotify/options.cpp @@ -114,13 +114,16 @@ void SaveTemplates() DBWriteContactSettingTString(0, MODULE, "TLogOpening", templates.LogOpening); DBWriteContactSettingByte(0, MODULE, "TPopupFlags", templates.PopupFlags); DBWriteContactSettingByte(0, MODULE, "TLogFlags", templates.LogFlags); - for (int i = 0; i < ProtoTemplates->realCount; i++) + if(ProtoTamplates!=NULL) { - PROTOTEMPLATE *prototemplate = (PROTOTEMPLATE *)ProtoTemplates->items[i]; - TCHAR str[MAX_PATH]; - mir_sntprintf(str, SIZEOF(str), _T("%s_TSMChange"), prototemplate->ProtoName); - char *szstr = mir_t2a(str); - DBWriteContactSettingTString(0, MODULE, szstr, prototemplate->ProtoTemplate); + for (int i = 0; i < ProtoTemplates->realCount; i++) + { + PROTOTEMPLATE *prototemplate = (PROTOTEMPLATE *)ProtoTemplates->items[i]; + TCHAR str[MAX_PATH]; + mir_sntprintf(str, SIZEOF(str), _T("%s_TSMChange"), prototemplate->ProtoName); + char *szstr = mir_t2a(str); + DBWriteContactSettingTString(0, MODULE, szstr, prototemplate->ProtoTemplate); + } } } -- cgit v1.2.3