From b563d8da7d07e67aa7a88b607b2f91a4ba39cb62 Mon Sep 17 00:00:00 2001 From: N-Pex Date: Tue, 26 Sep 2017 10:43:35 +0200 Subject: [PATCH] Fix build problem --- .../Classes/Controllers/OTROMEMOSignalCoordinator.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChatSecure/Classes/Controllers/OTROMEMOSignalCoordinator.swift b/ChatSecure/Classes/Controllers/OTROMEMOSignalCoordinator.swift index 0f0723b5b..39da55c56 100644 --- a/ChatSecure/Classes/Controllers/OTROMEMOSignalCoordinator.swift +++ b/ChatSecure/Classes/Controllers/OTROMEMOSignalCoordinator.swift @@ -145,10 +145,10 @@ import SignalProtocolObjC fileprivate func fetchUsername(_ yapKey:String, yapCollection:String, transaction:YapDatabaseReadTransaction) -> String? { if let object = transaction.object(forKey: yapKey, inCollection: yapCollection) { - if object is OTRAccount { - return (object as AnyObject).username - } else if object is OTRBuddy { - return (object as AnyObject).username + if let account = object as? OTRAccount { + return account.username + } else if let buddy = object as? OTRBuddy { + return buddy.username } } return nil