Skip to content

Commit 92ce944

Browse files
committed
fix NPE
1 parent 15f8a7c commit 92ce944

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_store

gocksnap.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,13 @@ func (g *Snapshot) promptCall(req *http.Request, existingCall *Call) *Call {
136136
Headers: req.Header,
137137
QueryParams: queryParams,
138138
},
139-
ExistingResponse: &existingCall.MockedCall,
140139
finalCall: finalCall,
141140
}
142141

142+
if existingCall != nil {
143+
g.pending.ExistingResponse = &existingCall.MockedCall
144+
}
145+
143146
// notify SSE clients
144147
for ch := range g.sseConns {
145148
select {

0 commit comments

Comments
 (0)