File tree Expand file tree Collapse file tree
src/main/java/com/couchbase/lite Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ public boolean setMapReduce(Mapper mapBlock,
247247 */
248248 @ InterfaceAudience .Public
249249 public void deleteIndex () {
250- if (getViewId () < 0 ) {
250+ if (getViewId () <= 0 ) {
251251 return ;
252252 }
253253
@@ -295,18 +295,15 @@ public Query createQuery() {
295295 public int getViewId () {
296296 if (viewId < 0 ) {
297297 String sql = "SELECT view_id FROM views WHERE name=?" ;
298- String [] args = { name };
298+ String [] args = {name };
299299 Cursor cursor = null ;
300300 try {
301301 cursor = database .getDatabase ().rawQuery (sql , args );
302302 if (cursor .moveToNext ()) {
303303 viewId = cursor .getInt (0 );
304- } else {
305- viewId = 0 ;
306304 }
307305 } catch (SQLException e ) {
308306 Log .e (Log .TAG_VIEW , "Error getting view id" , e );
309- viewId = 0 ;
310307 } finally {
311308 if (cursor != null ) {
312309 cursor .close ();
You can’t perform that action at this time.
0 commit comments