Apologies to Dunkin' Donuts for having a single quoted string in here making you crash the app

parent 2d8fd574
......@@ -210,8 +210,8 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
@objc func toDetailFromURL(_ notification: Notification) {
let facilityEncoded = notification.userInfo!["facility"] as? String
let facilityDecoded = facilityEncoded?.removingPercentEncoding
let facility = realm.objects(WOPFacilitiesModel.self)[0].facilities.filter(NSPredicate(format: "facilityName = '" + (facilityDecoded)! + "'")).first
print(facilityDecoded)
let facility = realm.objects(WOPFacilitiesModel.self)[0].facilities.filter(NSPredicate(format: "facilityName = \"" + (facilityDecoded)! + "\"")).first
if(facility == nil) {
return // don't do anything
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment