             if (error != nil) {
                 NSLog("Error retrieving player info: \(error.localizedDescription)")
                 self.matchStarted = false
-                self.delegate.matchEnded()
+                self.delegate?.matchEnded()
             } else {
                 for player in players {
                     NSLog("Found player: \(player.alias)")

            lookupPlayers()
        case .StateDisconnected:
            matchStarted = false
            delegate.matchEnded()
            match = nil
        default:
            break

        
        NSLog("Match failed with error: \(error.localizedDescription)")
        matchStarted = false
        delegate?.matchEnded()
    }
    
    // MARK: GKLocalPlayerListener
