Skip to content

Commit

Permalink
MM-56718: Conditionally access post (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebroseland authored Feb 14, 2024
1 parent c5bc5e5 commit e1e08bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default class Plugin {
registry.registerGlobalComponent(injectIntl(IncomingCallContainer));

registry.registerFilePreviewComponent((fi, post) => {
return String(post.type) === CALL_RECORDING_POST_TYPE;
return String(post?.type) === CALL_RECORDING_POST_TYPE;
}, RecordingsFilePreview);

registry.registerTranslations((locale: string) => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/types/mattermost-webapp/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface PluginRegistry {

registerTranslations(handler: (locale: string) => Translations | Promise<Translations>);

registerFilePreviewComponent(overrideFn: (fi: FileInfo, post: Post) => boolean, component: React.ElementType);
registerFilePreviewComponent(overrideFn: (fi: FileInfo, post?: Post) => boolean, component: React.ElementType);
}

export type SlashCommandWillBePostedReturn = { error: string } | { message: string, args: CommandArgs } | unknown;
Expand Down

0 comments on commit e1e08bc

Please sign in to comment.