Skip to content

Commit b734b91

Browse files
alfavatarswave
authored andcommitted
Dispatch failure on main queue to prevent crash
1 parent 386c9d3 commit b734b91

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sources/CodeScanner/ScannerViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ extension CodeScannerView {
508508
}
509509

510510
func didFail(reason: ScanError) {
511-
parentView.completion(.failure(reason))
511+
DispatchQueue.main.async {
512+
self.parentView.completion(.failure(reason))
513+
}
512514
}
513515

514516
}

0 commit comments

Comments
 (0)