Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/notion-client/notion-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ export class NotionAPI {
const pageBlockId = Object.keys(recordMap.block)[0];
const pageBlock = recordMap.block[pageBlockId].value;
const authorId = pageBlock.created_by_id;
const users = await this.getUsers([authorId]);
const author = users.results[0];

recordMap.notion_user = {
[authorId]: author,
};
if (authorId) {
const users = await this.getUsers([authorId]);
const author = users.results[0];
recordMap.notion_user = {
[authorId]: author,
};
}

// ensure that all top-level maps exist
recordMap.collection = recordMap.collection ?? {};
Expand Down