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

Commit 24f7b559 authored by Tom Marshall's avatar Tom Marshall Committed by Rashed Abdel-Tawab
Browse files

MTP: Fix crash when no storages are available

Change-Id: I6d7202ade46a5d781a3db5a1a3bdde17c8e70a60

MTP: Return nullptr, not NULL

Change-Id: I6dcd4d6ea10661917d9d9b0ae62d85000db89c35
parent d7d4a2fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ void MtpServer::removeStorage(MtpStorage* storage) {

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