Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix "TypeError: Cannot read properties of null (reading 'replace')" in Trajectory viewer (#989)

Bala05212c1ad9b4
diff --git a/sweagent/inspector/fileViewer.js b/sweagent/inspector/fileViewer.js
index 909d30b3..78825ce8 100644
--- a/sweagent/inspector/fileViewer.js
+++ b/sweagent/inspector/fileViewer.js
@@ -36,6 +36,9 @@ function createTrajectoryItem(item, index) {
const hasMessages = item.messages && item.messages.length > 0;
const escapeHtml = (text) => {
+ if (!text) {
+ return "";
+ }
return text
.replace(/&/g, "&")
.replace(/</g, "&lt;")