summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mail.c3
-rw-r--r--noannounce.c13
-rw-r--r--noannounce.h1
3 files changed, 11 insertions, 6 deletions
diff --git a/mail.c b/mail.c
index 90c93ed..9ec7300 100644
--- a/mail.c
+++ b/mail.c
@@ -488,7 +488,8 @@ void cMailUpdateNotifier::SendUpdateNotifications()
for (itae = announceEvents.begin(); itae != announceEvents.end(); itae++)
{
cNoAnnounce* noAnnounce = new cNoAnnounce(itae->GetEvent());
- NoAnnounces.Add(noAnnounce);
+ if (noAnnounce && noAnnounce->Valid())
+ NoAnnounces.Add(noAnnounce);
}
if (announceEvents.size() > 0)
{
diff --git a/noannounce.c b/noannounce.c
index 6ce8ed2..3c81066 100644
--- a/noannounce.c
+++ b/noannounce.c
@@ -42,11 +42,14 @@ cNoAnnounce::cNoAnnounce(const cEvent* e, time_t NextAnnounce)
title = shortText = "";
startTime = 0;
buffer = NULL;
- if (e->Title()) title = e->Title();
- if (e->ShortText()) shortText = e->ShortText();
- channelID = e->ChannelID();
- startTime = e->StartTime();
- nextAnnounce = NextAnnounce;
+ if (e)
+ {
+ if (e->Title()) title = e->Title();
+ if (e->ShortText()) shortText = e->ShortText();
+ channelID = e->ChannelID();
+ startTime = e->StartTime();
+ nextAnnounce = NextAnnounce;
+ }
}
cNoAnnounce::~cNoAnnounce(void)
diff --git a/noannounce.h b/noannounce.h
index e497b03..c13aeac 100644
--- a/noannounce.h
+++ b/noannounce.h
@@ -50,6 +50,7 @@ public:
bool Parse(const char *s);
const char *ToText(void) const;
bool Save(FILE *f);
+ bool Valid() { return startTime > 0; }
};
class cNoAnnounces : public cConfig<cNoAnnounce> {