Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when scanning subnet devices for Android Tv #117

Open
IbrohimDev opened this issue Nov 10, 2023 · 0 comments
Open

NullPointerException when scanning subnet devices for Android Tv #117

IbrohimDev opened this issue Nov 10, 2023 · 0 comments

Comments

@IbrohimDev
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant