Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 217b984

Browse files
committed
Fix crash in res.send()
In commit c6fa259, "var" usage was replaced with const. The code previously worked because "var" has function scoping unlike const which has block scoping. TypeError: Cannot read property 'attributes' of null
1 parent da358a8 commit 217b984

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/messages/search_response.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SearchResponse.prototype.send = function (entry, nofiltering) {
4242
const self = this
4343

4444
const savedAttrs = {}
45-
const save = null
45+
let save = null
4646
if (entry instanceof SearchEntry || entry instanceof SearchReference) {
4747
if (!entry.messageID) { entry.messageID = this.messageID }
4848
if (entry.messageID !== this.messageID) { throw new Error('SearchEntry messageID mismatch') }
@@ -66,7 +66,7 @@ SearchResponse.prototype.send = function (entry, nofiltering) {
6666
}
6767
})
6868

69-
const save = entry
69+
save = entry
7070
entry = new SearchEntry({
7171
objectName: typeof (save.dn) === 'string' ? parseDN(save.dn) : save.dn,
7272
messageID: self.messageID,

0 commit comments

Comments
 (0)