diff --git a/packages/attribution/src/attribution.ts b/packages/attribution/src/attribution.ts index 86972e3a0..9d5a5b52c 100644 --- a/packages/attribution/src/attribution.ts +++ b/packages/attribution/src/attribution.ts @@ -202,7 +202,7 @@ export class Attribution { const attribution = createLicensorAttribution(providers); const list = this.renderList(filtered); - if (list.length) { + if (list.length > 0) { return `${attribution} - ${list}`; } else { return attribution; diff --git a/packages/lambda-tiler/src/routes/attribution.ts b/packages/lambda-tiler/src/routes/attribution.ts index e6cb4dc93..83c565eb0 100644 --- a/packages/lambda-tiler/src/routes/attribution.ts +++ b/packages/lambda-tiler/src/routes/attribution.ts @@ -239,11 +239,11 @@ export async function createTileSetAttribution( // ensure imagery exist for the given projection const imgId = tileSet.layers[0][projection.code]; - if (imgId === undefined) return ''; + if (imgId == null) return ''; // attempt to load the imagery const imagery = await provider.Imagery.get(imgId); - if (imagery == null || imagery.providers == null) { + if (imagery?.providers == null) { return createLicensorAttribution(); } diff --git a/packages/landing/src/attribution.ts b/packages/landing/src/attribution.ts index 4e0c55dcf..2c132f4df 100644 --- a/packages/landing/src/attribution.ts +++ b/packages/landing/src/attribution.ts @@ -167,7 +167,7 @@ export class MapAttribution implements maplibre.IControl { Config.map.emit('visibleLayers', filteredLayerIds); const attributionHTML = attr.renderLicense(filtered); - this.setAttribution(attributionHTML ?? ''); + this.setAttribution(attributionHTML); }; setAttribution(text: string): void {