Skip to content

Commit 57ca4e0

Browse files
authored
Fix crash when integration is not installed on the space (#3040)
1 parent bc90adb commit 57ca4e0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/six-camels-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Fix a crash when a page contains a block of an integration that is no longer installed

packages/gitbook/src/components/DocumentView/Integration/IntegrationBlock.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export async function IntegrationBlock(props: BlockProps<DocumentBlockIntegratio
3434
dataFetcher.renderIntegrationUi({
3535
integrationName: block.data.integration,
3636
request: initialInput,
37-
})
37+
}),
38+
39+
// The API can respond with a 400 error if the integration is not installed
40+
// and 404 if the integration is not found.
41+
[404, 400]
3842
);
3943
if (!initialOutput || initialOutput.type === 'complete') {
4044
return null;

0 commit comments

Comments
 (0)