<table><tr><td style="">fvogt added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28535">View Revision</a></tr></table><br /><div><div><p>There is no such thing as an "invalid device" at that point anymore. There's only nullptr.</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">LIBMTP_mtpdevice_t *MTPDevice::getDevice()
{
if (!m_mtpdevice->storage) {
qCDebug(LOG_KIOD_KMTPD) << "no storage found: reopen mtpdevice";
LIBMTP_Release_Device(m_mtpdevice);
m_mtpdevice = LIBMTP_Open_Raw_Device_Uncached(&m_rawdevice);
}
return m_mtpdevice;
}</pre></div>
<p>What you're suggesting is to change <tt style="background: #ebebeb; font-size: 13px;">MTPDevice::getDevice</tt> to return the old device if reopening fails - but reopening without releasing might not work.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R320 KIO Extras</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28535">https://phabricator.kde.org/D28535</a></div></div><br /><div><strong>To: </strong>feverfew, akrutzler, dfaure, elvisangelaccio<br /><strong>Cc: </strong>anthonyfieroni, kde-frameworks-devel, fvogt, kfm-devel, ngraham, nikolaik, pberestov, iasensio, fprice, LeGast00n, cblack, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, andrebarros, bruns, emmanuelp, mikesomov<br /></div>