From 5aeef81d07372fc8c097610534e7f37203324799 Mon Sep 17 00:00:00 2001 From: Ralf Schimmel Date: Tue, 30 Dec 2025 14:26:28 +0100 Subject: [PATCH] fix: handle null user in comment transform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linear's agent protocol can create system comments with user: null. Add null-check to prevent "Cannot read properties of null" error when transforming issues with such comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/utils/graphql-issues-service.ts | 10 ++++++---- src/utils/linear-types.d.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/utils/graphql-issues-service.ts b/src/utils/graphql-issues-service.ts index 6a5e1fe..fb9ece3 100644 --- a/src/utils/graphql-issues-service.ts +++ b/src/utils/graphql-issues-service.ts @@ -881,10 +881,12 @@ export class GraphQLIssuesService { id: comment.id, body: comment.body, embeds: extractEmbeds(comment.body), - user: { - id: comment.user.id, - name: comment.user.name, - }, + user: comment.user + ? { + id: comment.user.id, + name: comment.user.name, + } + : undefined, createdAt: comment.createdAt instanceof Date ? comment.createdAt.toISOString() : (comment.createdAt diff --git a/src/utils/linear-types.d.ts b/src/utils/linear-types.d.ts index ec24d51..52aa03a 100644 --- a/src/utils/linear-types.d.ts +++ b/src/utils/linear-types.d.ts @@ -153,7 +153,7 @@ export interface CreateCommentArgs { export interface LinearComment { id: string; body: string; - user: { + user?: { id: string; name: string; };