From 1546eaa9a8bc093fb47944481128c4728b47cb5f Mon Sep 17 00:00:00 2001 From: ErstwhileWork Date: Mon, 13 Jun 2016 20:30:53 -0400 Subject: [PATCH] Update GeoFire.java Replace call to missing DatabaseReference.fromStatus() method (in Firebase 3.0) with the use of DatabaseException Replace line 80 in GeoFire with the lines below (and add an import of import com.google.firebase.database.DatabaseException;) DatabaseException exception = new DatabaseException(message); this.callback.onCancelled(DatabaseError.fromException(exception)); --- src/main/java/com/firebase/geofire/GeoFire.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/firebase/geofire/GeoFire.java b/src/main/java/com/firebase/geofire/GeoFire.java index 5bd1eb9..cc7f09c 100644 --- a/src/main/java/com/firebase/geofire/GeoFire.java +++ b/src/main/java/com/firebase/geofire/GeoFire.java @@ -31,6 +31,7 @@ import com.firebase.geofire.core.GeoHash; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseException; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.ValueEventListener; import com.google.firebase.database.GenericTypeIndicator; @@ -76,8 +77,9 @@ public void onDataChange(DataSnapshot dataSnapshot) { if (location != null) { this.callback.onLocationResult(dataSnapshot.getKey(), location); } else { - String message = "GeoFire data has invalid format: " + dataSnapshot.getValue(); - this.callback.onCancelled(DatabaseError.fromStatus(message)); + String message = "GeoFire data has invalid format: " + dataSnapshot.getValue() + DatabaseException exception = new DatabaseException(message); + this.callback.onCancelled(DatabaseError.fromException(exception)); } } }