Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d948a1d authored by Tom Marshall's avatar Tom Marshall
Browse files

MTP: Fix crash when no storages are available

Jira: CYNGNOS-3045

Change-Id: I6d7202ade46a5d781a3db5a1a3bdde17c8e70a60
(cherry picked from commit 9bdc0f69)
parent 7d235992
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ void MtpServer::removeStorage(MtpStorage* storage) {

MtpStorage* MtpServer::getStorage(MtpStorageID id) {
    if (id == 0)
        return mStorages[0];
        return mStorages.empty() ? NULL : mStorages[0];
    for (size_t i = 0; i < mStorages.size(); i++) {
        MtpStorage* storage = mStorages[i];
        if (storage->getStorageID() == id)