diff --git a/src/app/cmd/drop_on_timeline.cpp b/src/app/cmd/drop_on_timeline.cpp index cf7085504..636211ad6 100644 --- a/src/app/cmd/drop_on_timeline.cpp +++ b/src/app/cmd/drop_on_timeline.cpp @@ -111,11 +111,18 @@ bool DropOnTimeline::getNextDocFromPaths(Doc** srcDoc) std::unique_ptr fop( FileOp::createLoadDocumentOperation(context, m_paths.front(), flags)); + // Remove the path that is currently being processed + m_paths.erase(m_paths.begin()); // Do nothing (the user cancelled or something like that) if (!fop) return false; + if (fop->hasError()) { + console.printf(fop->error().c_str()); + return true; + } + base::paths fopFilenames; fop->getFilenameList(fopFilenames); // Remove paths that will be loaded by the current file operation. @@ -125,11 +132,6 @@ bool DropOnTimeline::getNextDocFromPaths(Doc** srcDoc) m_paths.erase(it); } - if (fop->hasError()) { - console.printf(fop->error().c_str()); - return true; - } - OpenFileJob task(fop.get(), true); task.showProgressWindow();