Skip to content

Commit

Permalink
fix: all tiff alignment should be validated TDE-1013 (#882)
Browse files Browse the repository at this point in the history
#### Motivation

A regression that avoid validating all Tiff alignments has been
introduced in #877 where the
validateTiffAlignment() could not be called if `allValid` is false (due
to short-circuited evaluation).

#### Modification

Store the result of each validation in a variable to make sure the
function is called each time.

#### Checklist

- [ ] Tests updated N/A
- [ ] Docs updated N/A
- [x] Issue linked in Title
  • Loading branch information
paulfouquet authored Feb 25, 2024
1 parent 963f462 commit 3642257
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/tileindex-validate/tileindex.validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ export const commandTileIndexValidate = command({
if (args.validate) {
let allValid = true;
for (const tiff of locations) {
allValid = allValid && validateTiffAlignment(tiff);
const currentValid = validateTiffAlignment(tiff);
allValid = allValid && currentValid;
}
if (!allValid) throw new Error(`Tile alignment validation failed`);
}
Expand Down

0 comments on commit 3642257

Please sign in to comment.