Skip to content

Commit

Permalink
Fixed a crash reporting errors from a CBLReplication
Browse files Browse the repository at this point in the history
NOTE: This patch was made on the stable branch as a fix for beta 2.
It does _not_ need to be merged into master, because CBLReplicator has
been rewritten since beta 2 and this bug doesn’t exist there.

Fixes #220
  • Loading branch information
snej committed Jan 15, 2014
1 parent 8783a96 commit 5c3641e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/API/CBLReplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,14 @@ - (void) bg_updateProgress: (CBL_Replicator*)tdReplicator {
mode = tdReplicator.active ? kCBLReplicationActive : kCBLReplicationIdle;

// Communicate its state back to the main thread:
NSError* error = tdReplicator.error;
NSUInteger changesProcessed = tdReplicator.changesProcessed;
NSUInteger changesTotal = tdReplicator.changesTotal;
MYOnThread(_mainThread, ^{
[self updateMode: mode
error: tdReplicator.error
processed: tdReplicator.changesProcessed
ofTotal: tdReplicator.changesTotal];
error: error
processed: changesProcessed
ofTotal: changesTotal];
});

if (_bg_replicator && mode == kCBLReplicationStopped) {
Expand Down

0 comments on commit 5c3641e

Please sign in to comment.