Skip to content

NullPointerException when scanning subnet devices for Android Tv #117

@IbrohimDev

Description

@IbrohimDev
override suspend fun getDevicesInLan(ipAddress: String): Flow<DeviceData> =
    callbackFlow {
        val subNetDevices = SubnetDevices.fromLocalAddress()
            .findDevices(object : SubnetDevices.OnSubnetDeviceFound {
                override fun onDeviceFound(device: Device?) {
               
                }
                override fun onFinished(devicesFound: java.util.ArrayList<Device>?) {
               
                }
            })
        awaitClose { subNetDevices.cancel() }
    }
    
    I got the error when running this code and it conveys me 
     java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.Enumeration.hasMoreElements()' on a null object reference
     
     this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions