Browse Source

fix: fatal: undefined is not an object (evaluating 'color.buffer')

Aiden Cline 3 months ago
parent
commit
b9b071c744
1 changed files with 1 additions and 0 deletions
  1. 1 0
      packages/opencode/src/cli/cmd/tui/context/local.tsx

+ 1 - 0
packages/opencode/src/cli/cmd/tui/context/local.tsx

@@ -94,6 +94,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
           const agent = agents().find((x) => x.name === name)
           const agent = agents().find((x) => x.name === name)
           if (agent?.color) return RGBA.fromHex(agent.color)
           if (agent?.color) return RGBA.fromHex(agent.color)
           const index = agents().findIndex((x) => x.name === name)
           const index = agents().findIndex((x) => x.name === name)
+          if (index === -1) return colors()[0]
           return colors()[index % colors().length]
           return colors()[index % colors().length]
         },
         },
       }
       }