     }
 }
 
+// Radius can be used in code that will crash (e.g. geofire) when
+// it's a questionable value - we guard against that here.
+class RemoteConfigRadius: RemoteConfigProperty<Double> {
+    fileprivate override func convert(_ string: String) -> Double? {
+        guard let val = Double(string),
+                val > 0 else {
+            return nil // will use default value
+        }
+        return val
+    }
+}
+
 class RemoteConfigDouble: RemoteConfigProperty<Double> {
     fileprivate override func convert(_ string: String) -> Double? {
         return Double(string)


    // The event search radius the app will use to query the Firebase datbase
    // This is measures in kilometers.
    public static let eventSearchRadiusInKm = RemoteConfigDouble(key: "event_search_radius_in_km", defaultValue: 40.0)

    // the strings that are in the config for event notifications and display of events on cards
    public static let endingEventNotificationString = RemoteConfigString(key: "ending_event_notification_string", defaultValue: "{event_name} - will end soon and you're close by!")


    // The search radius the app will use to query the Firebase database.
    // This is measured in kilometers.
    public static let searchRadiusInKm = RemoteConfigRadius(key: "search_radius_in_km", defaultValue: 1.0)

    // The minimum number of minutes walking to the venue to be considered at the venue.at
    // This is measured in minutes.
