Skip to content

Commit

Permalink
Fix log line assertion error (#1703)
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-rc authored Oct 9, 2024
1 parent 63e3a69 commit da25b70
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .changeset/fix-empty-string-assertion-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
ggt: "patch"
---

Fix the following assertion error from occurring:

```
An error occurred while communicating with Gadget
'' == true
If you think this is a bug, click here to create an issue on GitHub.
```
4 changes: 2 additions & 2 deletions src/services/output/log/format/pretty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import terminalLink from "terminal-link";
import { type Environment } from "../../../app/app.js";

import { config } from "../../../config/config.js";
import { isObject } from "../../../util/is.js";
import { isNil, isObject } from "../../../util/is.js";
import { serializeObjectToHTTPQuery } from "../../../util/querystring.js";
import colors from "../../colors.js";
import { symbol } from "../../symbols.js";
Expand Down Expand Up @@ -47,7 +47,7 @@ const formatValue = (value: string, color: (s: string) => string, indent: number

const buf: string[] = [];
const firstLine = lines.shift();
assert(firstLine);
assert(!isNil(firstLine), "first line is nil");
buf.push(color(firstLine));

// color the rest of the lines
Expand Down

0 comments on commit da25b70

Please sign in to comment.