Commit f7b9b827 authored by Kevin Funk's avatar Kevin Funk

A couple of fixes for the MTP kio slave (2 patches)

mtp: Simplify code a bit

Only one branch can be taken per call, make this clear by using
if/else-if instead of a series of ifs.

mtp: Don't crash if getPath returns something invalid

This happens when you try to copy a file from a device which just got
locked again (I think...)

Reviewers: elvisangelaccio

Reviewed By: elvisangelaccio

Differential Revision:
parent bdd0e54e
......@@ -705,6 +705,10 @@ void MTPSlave::copy(const QUrl &src, const QUrl &dest, int, JobFlags flags)
QPair<void *, LIBMTP_mtpdevice_t *> pair = getPath(src.path());
if (!pair.first) {
error(ERR_COULD_NOT_READ, src.path());
LIBMTP_mtpdevice_t *device = pair.second;
LIBMTP_file_t *source = (LIBMTP_file_t *) pair.first;
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