fixes issue #225

Code change merged from PR couchbase/couchbase-lite-android/pull/329 by @pegli