Skip to content

Commit

Permalink
fixes getLogo for Providers with no Logo (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmisson authored Nov 26, 2024
1 parent 63a230d commit 56b02cb
Show file tree
Hide file tree
Showing 5 changed files with 17,167 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/IIIFResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ export class IIIFResource extends ManifestResource {

// get the first agent in the provider array with a logo
const agent = provider.find(item => item.logo !== undefined);
logo = typeof agent.logo === "undefined" ? null : agent.logo;
if (agent && agent.logo !== undefined) {
logo = agent.logo;
} else {
logo = null;
}
}

if (!logo) return null;
Expand Down
Loading

0 comments on commit 56b02cb

Please sign in to comment.