Skip to content

Commit

Permalink
Fix #435
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Jun 2, 2021
1 parent 626f47c commit 1c66b43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ If you are viewing this file on CRAN, please check [the latest news on GitHub](h
## lidR v3.1.4 (Release date: ...)

- Doc: fix some code block rendering in `catalog_apply` man page
- Fix: fix catalog processing engine edge case when the last chunks fail. See ([#435](https://github.com/Jean-Romain/lidR/issues/435)).

## lidR v3.1.3 (Release date: 2021-05-20)

Expand Down
7 changes: 6 additions & 1 deletion R/clusters_apply.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ cluster_apply = function(.CLUSTER, .FUN, .PROCESSOPT, .OUTPUTOPT, .GLOBALS = NUL
percentage <- engine_compute_progress(states)
engine_update_progress(pb, .CLUSTER[[j]], states[j], percentage, j)

if (states[j] == CHUNK_ERROR & abort)
if (states[j] == CHUNK_ERROR && abort)
{
if (j == 1)
{
Expand All @@ -195,6 +195,11 @@ cluster_apply = function(.CLUSTER, .FUN, .PROCESSOPT, .OUTPUTOPT, .GLOBALS = NUL
}
}

if (states[j] == CHUNK_ERROR && !abort) {
output[[j]] <- NULL
next
}

if (states[j] == CHUNK_NULL) next

output[[j]] <- suppressWarnings(future::value(futures[[j]]))
Expand Down

0 comments on commit 1c66b43

Please sign in to comment.