Commit de5afafb authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Task: Gracefully handle potentially invalid tasks

parent 7f3f137b
...@@ -135,6 +135,12 @@ int64_t Task::id() const ...@@ -135,6 +135,12 @@ int64_t Task::id() const
bool Task::restoreLinkedEntities() bool Task::restoreLinkedEntities()
{ {
if ( m_fileId == 0 && mrl.empty() == true )
{
LOG_WARN( "Aborting & removing external file task (#", m_id, ')' );
destroy( m_ml, m_id );
return false;
}
// First of all, we need to know if the file has been created already // First of all, we need to know if the file has been created already
// ie. have we run the MetadataParser service, at least partially // ie. have we run the MetadataParser service, at least partially
file = File::fetch( m_ml, m_fileId ); file = File::fetch( m_ml, m_fileId );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment