Explorar o código

Merge branch 'Lablanca' into Sync

Iñigo Valentin %!s(int64=9) %!d(string=hai) anos
pai
achega
583b3f060d
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      app/LablancaView.swift

+ 6 - 3
app/LablancaView.swift

@@ -101,10 +101,13 @@ class LablancaView: UIView {
 			
 			// Get info from festivals
 			let searchResults = try context.fetch(fetchRequest)
-			let r = searchResults[0]
 			
-			// Set description
-			self.fText.text = r.value(forKey: "text_\(lang)") as! String?
+			if searchResults.count > 0 {
+				let r = searchResults[0]
+			
+				// Set description
+				self.fText.text = r.value(forKey: "text_\(lang)") as! String?
+			}
 
 		} catch {
 			NSLog(":LABLANCA:ERROR: Error getting festivals info: \(error)")