Skip to content

Commit 0724bf6

Browse files
committed
Fix pipeline validation in PDALCreatePipeline
1 parent a445550 commit 0724bf6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

source/pdal/capi/Pipeline.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,27 @@ namespace pdal
3636

3737
if (executor)
3838
{
39+
bool valid = false;
40+
3941
try
4042
{
41-
executor->validate();
43+
valid = executor->validate();
4244
}
4345
catch (const std::exception &e)
4446
{
45-
printf("Could not validate pipeline: %s\n%s\n", e.what(), json);
46-
delete executor;
47-
executor = NULL;
47+
printf("Error while validating pipeline: %s\n%s\n", e.what(), json);
4848
}
4949

50-
if (executor)
50+
if (valid)
5151
{
5252
pipeline = new Pipeline(executor);
5353
}
54+
else
55+
{
56+
delete executor;
57+
executor = NULL;
58+
printf("The pipeline is invalid:\n%s\n", json);
59+
}
5460
}
5561
}
5662

0 commit comments

Comments
 (0)