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

Folder: Handle sporadic read error gracefully

parent 6e29f0c4
......@@ -281,7 +281,12 @@ bool Folder::isPresent() const
auto deviceLock = m_device.lock();
if ( m_device.isCached() == false )
m_device = Device::fetch( m_ml, m_deviceId );
// There must be a device containing the folder, since we never create a folder
// without a device
assert( m_device.get() != nullptr );
// However, handle potential sporadic errors gracefully
if( m_device.get() == nullptr )
return false;
return m_device.get()->isPresent();
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