Skip to content

Commit

Permalink
make current label optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ElinorW committed Mar 21, 2024
1 parent 5e9c4e2 commit d3017d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DocumentationService implements IDocumentationService {

public getDocumentationLink = (): string => {
const link = this.getSampleDocumentationUrl() || this.getResourceDocumentationUrl();
return link || '';
return link ? link : '';
}

private getSampleDocumentationUrl = (): string => {
Expand Down Expand Up @@ -69,7 +69,7 @@ class DocumentationService implements IDocumentationService {
if (matchingResource && matchingResource.labels.length > 0) {
const currentLabel = matchingResource.labels.filter(k => k.name === this.queryVersion)[0];

const method = currentLabel.methods[0];
const method = currentLabel?.methods[0];
if (typeof method === 'string') {
return null;
}
Expand Down

0 comments on commit d3017d0

Please sign in to comment.