Fix args can be null
This commit is contained in:
@@ -92,7 +92,7 @@ object WifiP2pManagerHelper {
|
||||
val proxy = Proxy.newProxyInstance(interfacePersistentGroupInfoListener.classLoader,
|
||||
arrayOf(interfacePersistentGroupInfoListener)) { proxy, method, args ->
|
||||
if (method.name == "onPersistentGroupInfoAvailable") {
|
||||
if (args.size != 1) Timber.w(IllegalArgumentException("Unexpected args: $args"))
|
||||
if (args?.size != 1) Timber.w(IllegalArgumentException("Unexpected args: $args"))
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
listener(getGroupList.invoke(args[0]) as Collection<WifiP2pGroup>)
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user