Skip to content

Commit

Permalink
Handle empty issue body when removing HTML
Browse files Browse the repository at this point in the history
If an issue is created with an empty body, the action fails when calling `replace` on `null`
  • Loading branch information
conarro authored Sep 28, 2021
1 parent 3128dae commit cc32d45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {InputPropertyValueMap} from '@notionhq/client/build/src/api-endpoin
import {SelectPropertyValue} from '@notionhq/client/build/src/api-types';

function removeHTML(text: string): string {
return text.replace(/<.*>.*<\/.*>/g, '');
return text ? text.replace(/<.*>.*<\/.*>/g, '') : '';
}

function getStatusSelectOption(state: 'open' | 'closed'): Omit<SelectPropertyValue, 'id'> {
Expand Down

0 comments on commit cc32d45

Please sign in to comment.