Skip to content

Commit de33dc4

Browse files
committed
Fix loading history with null responses
1 parent a19cff9 commit de33dc4

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/BookmarkOptions.kt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ class BookmarkOptions(
3939
bookmarksPanel.model.refreshBookmarks()
4040
SwingUtilities.invokeLater {
4141
val bookmarks = bookmarksPanel.bookmarks
42-
val bookmarkRequests = bookmarks.map { callbacks.helpers.bytesToString(it.requestResponse.request) }
43-
val bookmarkResponses =
44-
bookmarks.map { callbacks.helpers.bytesToString(it.requestResponse.response ?: ByteArray(0)) }
42+
val bookmarkRequestResponse = bookmarks.map {
43+
Pair(
44+
callbacks.helpers.bytesToString(it.requestResponse.request),
45+
callbacks.helpers.bytesToString(it.requestResponse.response ?: ByteArray(0))
46+
)
47+
}
4548
val proxyHistory = callbacks.proxyHistory.asSequence()
4649
val bookmarksToAdd = proxyHistory
4750
.filter { it.highlight != null }
4851
.filterNot {
49-
bookmarkRequests.contains(callbacks.helpers.bytesToString(it.request)) &&
50-
bookmarkResponses.contains(
51-
callbacks.helpers.bytesToString(it.response)
52-
)
52+
bookmarkRequestResponse.contains(
53+
Pair(
54+
callbacks.helpers.bytesToString(it.request),
55+
callbacks.helpers.bytesToString(it.response ?: ByteArray(0))
56+
)
57+
)
5358
}
5459
.distinct()
5560
.toList()

0 commit comments

Comments
 (0)