Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
#168: c96d225: fixed feed parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
hugbug committed Feb 19, 2016
1 parent b9076fc commit 177be15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions daemon/feed/FeedCoordinator.cpp
Expand Up @@ -362,13 +362,15 @@ void FeedCoordinator::FeedCompleted(FeedDownloader* feedDownloader)
FeedScriptController::ExecuteScripts(
!Util::EmptyStr(feedInfo->GetFeedScript()) ? feedInfo->GetFeedScript(): g_Options->GetFeedScript(),
feedInfo->GetOutputFilename(), feedInfo->GetId());

std::unique_ptr<FeedFile> feedFile = std::make_unique<FeedFile>(feedInfo->GetOutputFilename());
bool parsed = feedFile->Parse();
FileSystem::DeleteFile(feedInfo->GetOutputFilename());

NzbList addedNzbs;

m_downloadsMutex.Lock();
if (feedFile->Parse())
if (parsed)
{
ProcessFeed(feedInfo, feedFile->GetFeedItemInfos(), &addedNzbs);
feedFile.reset();
Expand Down Expand Up @@ -584,9 +586,10 @@ bool FeedCoordinator::PreviewFeed(int id, const char* name, const char* url, con
feedFile = std::make_unique<FeedFile>(feedInfo->GetOutputFilename());
}

bool parsed = feedFile && feedFile->Parse();
FileSystem::DeleteFile(feedInfo->GetOutputFilename());

if (!feedFile || !feedFile->Parse())
if (!parsed)
{
return false;
}
Expand Down

0 comments on commit 177be15

Please sign in to comment.