From 3a186e57df86c942c71b60886db3446ed357dab2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 13 Jul 2012 09:03:36 +0000 Subject: crash fix for IEView without themes git-svn-id: http://svn.miranda-ng.org/main/trunk@942 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/TemplateHTMLBuilder.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'plugins/IEView') diff --git a/plugins/IEView/TemplateHTMLBuilder.cpp b/plugins/IEView/TemplateHTMLBuilder.cpp index 11892151b0..36ecb5c353 100644 --- a/plugins/IEView/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/TemplateHTMLBuilder.cpp @@ -340,9 +340,9 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, bool isGrouping = false; // DWORD today = (DWORD)time(NULL); // today = today - today % 86400; - if (protoSettings == NULL) { + if (protoSettings == NULL) return; - } + hRealContact = getRealContact(event->hContact); szRealProto = getProto(hRealContact); szProto = getProto(event->pszProto, event->hContact); @@ -480,13 +480,13 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, } } else if (eventData->iType == IEED_EVENT_FILE) { tmpltName[1] = isHistory ? isSent ? "hFileOut" : "hFileIn" : isSent ? "FileOut" : "FileIn"; - Template *tmplt = tmpm->getTemplate(tmpltName[1]); + Template *tmplt = (tmpm == NULL) ? NULL : tmpm->getTemplate(tmpltName[1]); if (tmplt == NULL) { tmpltName[1] = isHistory ? "hFile" : "File"; } } else if (eventData->iType == IEED_EVENT_URL) { tmpltName[1] = isHistory ? isSent ? "hURLOut" : "hURLIn" : isSent ? "URLOut" : "URLIn"; - Template *tmplt = tmpm->getTemplate(tmpltName[1]); + Template *tmplt = (tmpm == NULL) ? NULL : tmpm->getTemplate(tmpltName[1]); if (tmplt == NULL) { tmpltName[1] = isHistory ? "hURL" : "URL"; } @@ -495,9 +495,8 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, } /* template-specific formatting */ for (int i=0;i<2;i++) { - Template *tmplt; - if (tmpltName[i] == NULL) continue; - tmplt = tmpm->getTemplate(tmpltName[i]); + if (tmpltName[i] == NULL || tmpm == NULL) continue; + Template *tmplt = tmpm->getTemplate(tmpltName[i]); if (tmplt == NULL) continue; for (Token *token = tmplt->getTokens();token!=NULL;token=token->getNext()) { const char *tokenVal; -- cgit v1.2.3