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

File: Add some assertion when fetching the parent folder

parent 034c51c6
......@@ -101,11 +101,17 @@ const std::string& File::mrl() const
if ( m_isRemovable == false )
return m_mrl;
// If the file is removable, then it needs to have a parent folder
assert( m_folderId != 0 );
if ( m_fullPath.empty() == false )
return m_fullPath;
auto folder = Folder::fetch( m_ml, m_folderId );
if ( folder == nullptr )
{
assert( !"Can't find the folder for an existing file" );
return m_mrl;
}
m_fullPath = folder->mrl() + m_mrl;
return m_fullPath;
}
......
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