From 94a319d1a6ce1035a0d6187e414f2672a27b4ddf Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 2 Sep 2013 17:54:54 +0200 Subject: fixed null pointer access --- imageserver.c | 3 ++- themoviedbscraper/themoviedbscraper.c | 2 +- thetvdbscraper/thetvdbscraper.c | 2 +- worker.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/imageserver.c b/imageserver.c index f638355..b6d8414 100644 --- a/imageserver.c +++ b/imageserver.c @@ -12,7 +12,8 @@ cImageServer::~cImageServer() { scrapType cImageServer::GetScrapType(const cEvent *event) { scrapType type = scrapNone; - type = overrides->Type(event->Title()); + string title = (event->Title())?event->Title():""; + type = overrides->Type(title); if (type != scrapNone) return type; int duration = event->Duration() / 60; diff --git a/themoviedbscraper/themoviedbscraper.c b/themoviedbscraper/themoviedbscraper.c index aadbb72..978c0f6 100644 --- a/themoviedbscraper/themoviedbscraper.c +++ b/themoviedbscraper/themoviedbscraper.c @@ -23,7 +23,7 @@ cMovieDBScraper::~cMovieDBScraper() { } void cMovieDBScraper::Scrap(const cEvent *event, int recordingID) { - string movieName = event->Title(); + string movieName = (event->Title())?event->Title():""; if (overrides->Ignore(movieName)) { return; } diff --git a/thetvdbscraper/thetvdbscraper.c b/thetvdbscraper/thetvdbscraper.c index f4b4b83..4e16a03 100644 --- a/thetvdbscraper/thetvdbscraper.c +++ b/thetvdbscraper/thetvdbscraper.c @@ -24,7 +24,7 @@ cTVDBScraper::~cTVDBScraper() { } void cTVDBScraper::Scrap(const cEvent *event, int recordingID) { - string seriesName = event->Title(); + string seriesName = (event->Title())?event->Title():""; if (overrides->Ignore(seriesName)) { return; } diff --git a/worker.c b/worker.c index 759e082..e354730 100644 --- a/worker.c +++ b/worker.c @@ -79,7 +79,8 @@ void cTVScraperWorker::SetDirectories(void) { scrapType cTVScraperWorker::GetScrapType(const cEvent *event) { scrapType type = scrapNone; - type = overrides->Type(event->Title()); + string title = (event->Title())?event->Title():""; + type = overrides->Type(title); if (type != scrapNone) return type; int duration = event->Duration() / 60; -- cgit v1.2.3