File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -548,17 +548,19 @@ int main(int argc, const char * argv[]) {
548548 }
549549 }
550550 else {
551- if (!boost::filesystem::exists (thepath) || !boost::filesystem::is_directory (thepath)) {
552- std::cerr << " ERROR: " << thepath << " is not a valid path. Can not read LAS file.\n " ;
551+ boost::filesystem::path p;
552+ try {
553+ p = canonical (thepath, ypcan).make_preferred ();
554+ }
555+ catch (boost::filesystem::filesystem_error &e) {
556+ std::cerr << " WARNING: " << e.what () << " . Abort." << std::endl;
553557 return EXIT_FAILURE;
554- } else {
555- PointFile pointFile;
556- boost::filesystem::path p = canonical (thepath, ypcan).make_preferred ();
557- pointFile.filename = p.string ();
558- pointFile.lasomits = lasomits;
559- pointFile.thinning = thinning;
560- elevationFiles.push_back (pointFile);
561558 }
559+ PointFile pointFile;
560+ pointFile.filename = p.string ();
561+ pointFile.lasomits = lasomits;
562+ pointFile.thinning = thinning;
563+ elevationFiles.push_back (pointFile);
562564 }
563565 }
564566 }
You can’t perform that action at this time.
0 commit comments