13
0

fix crash when using track templates caused by a recent change to the filescanner API. if the template contains no plugin states, the scanner would return a null pointer, and we would fail to notice

This commit is contained in:
Paul Davis 2013-04-06 11:21:09 -04:00
parent c7f4a20e89
commit 433e3bda70

View File

@ -18,6 +18,7 @@
*/
#include <algorithm>
#include <vector>
#include <glib.h>
#include <glib/gstdio.h>
@ -32,6 +33,7 @@
#include "pbd/file_utils.h"
#include "pbd/error.h"
#include "pbd/pathscanner.h"
#include "pbd/stl_delete.h"
#include "i18n.h"
@ -165,10 +167,14 @@ copy_files(const std::string & from_path, const std::string & to_dir)
{
PathScanner scanner;
vector<string*>* files = scanner (from_path, accept_all_files, 0, true, false);
for (vector<string*>::iterator i = files->begin(); i != files->end(); ++i) {
std::string from = Glib::build_filename (from_path, **i);
std::string to = Glib::build_filename (to_dir, **i);
copy_file (from, to);
if (files) {
for (vector<string*>::iterator i = files->begin(); i != files->end(); ++i) {
std::string from = Glib::build_filename (from_path, **i);
std::string to = Glib::build_filename (to_dir, **i);
copy_file (from, to);
}
vector_delete (files);
}
}