summaryrefslogtreecommitdiff
path: root/plugins/IEView/TemplateHTMLBuilder.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-13 09:03:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-13 09:03:36 +0000
commit3a186e57df86c942c71b60886db3446ed357dab2 (patch)
treea8e38f9d61a956b0127891054dbc73337ae1efe6 /plugins/IEView/TemplateHTMLBuilder.cpp
parent9a7e2f9fd248e17ffc5c2a8d9581172507ad8803 (diff)
crash fix for IEView without themes
git-svn-id: http://svn.miranda-ng.org/main/trunk@942 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/TemplateHTMLBuilder.cpp')
-rw-r--r--plugins/IEView/TemplateHTMLBuilder.cpp13
1 files changed, 6 insertions, 7 deletions
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;