triangle-utils 1.4.160 → 1.4.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,7 +134,7 @@ export class UtilsBedrock {
134
134
  if (verbosity > 1) {
135
135
  console.log(JSON.stringify(body.content, undefined, 4));
136
136
  }
137
- const text = body.content.filter((content) => content.type === "text")[0].text;
137
+ const text = body.content.filter((content) => content.type === "text")[0]?.text;
138
138
  return text;
139
139
  }
140
140
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.160",
3
+ "version": "1.4.161",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -166,7 +166,7 @@ export class UtilsBedrock {
166
166
  if (verbosity > 1) {
167
167
  console.log(JSON.stringify(body.content, undefined, 4))
168
168
  }
169
- const text = body.content.filter((content : any) => content.type === "text")[0].text
169
+ const text = body.content.filter((content : any) => content.type === "text")[0]?.text
170
170
  return text
171
171
  } catch (error) {
172
172
  if (error instanceof Error) {