Skip to content

Commit 0cb7768

Browse files
fix(lambda-tiler): corrected conditional logic
1 parent 8304f90 commit 0cb7768

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/attribution/src/attribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class Attribution {
202202
const attribution = createLicensorAttribution(providers);
203203
const list = this.renderList(filtered);
204204

205-
if (list.length) {
205+
if (list.length > 0) {
206206
return `${attribution} - ${list}`;
207207
} else {
208208
return attribution;

packages/lambda-tiler/src/routes/attribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ export async function createTileSetAttribution(
239239

240240
// ensure imagery exist for the given projection
241241
const imgId = tileSet.layers[0][projection.code];
242-
if (imgId === undefined) return '';
242+
if (imgId == null) return '';
243243

244244
// attempt to load the imagery
245245
const imagery = await provider.Imagery.get(imgId);
246-
if (imagery == null || imagery.providers == null) {
246+
if (imagery?.providers == null) {
247247
return createLicensorAttribution();
248248
}
249249

packages/landing/src/attribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class MapAttribution implements maplibre.IControl {
167167
Config.map.emit('visibleLayers', filteredLayerIds);
168168

169169
const attributionHTML = attr.renderLicense(filtered);
170-
this.setAttribution(attributionHTML ?? '');
170+
this.setAttribution(attributionHTML);
171171
};
172172

173173
setAttribution(text: string): void {

0 commit comments

Comments
 (0)