Skip to content

Commit 5f38654

Browse files
author
Clément Le Provost
committed
Fix potential bug: use a copy of the query for asynchronous operations
Incidentally, this also fixes a compilation warning.
1 parent 0d3d53e commit 5f38654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Offline/MirroredIndex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ import Foundation
520520
let callingQueue = NSOperationQueue.currentQueue() ?? NSOperationQueue.mainQueue()
521521
let operation = NSBlockOperation()
522522
operation.addExecutionBlock() {
523-
let (content, error) = self._searchMirror(query)
523+
let (content, error) = self._searchMirror(queryCopy)
524524
callingQueue.addOperationWithBlock() {
525525
if !operation.cancelled {
526526
completionHandler(content: content, error: error)

0 commit comments

Comments
 (0)