Skip to content

Permission Problem After Marshmallow #38

@WrathChaos

Description

@WrathChaos

Hello,
Thanks for great library.
I got a problem about permissions.. If user has no permissions on Camera and Storage, MagicalCamera itself cannot handle it and "return mapPermissions?.get(permission)!!" returns NullPointerException. (Tried on both Java and Kotlin)


 private fun isActivePermission(permission: String): Boolean {
        // This map is return in method onRequestPermissionsResult for view what permissions are actives
        if (android.os.Build.VERSION.SDK_INT >= 23) {
            if (mapPermissions != null) {
                if (mapPermissions!!.size > 0) {
                    // Obtain the code of camera permissions
                     return mapPermissions?.get(permission)!!
                } else {
                    return true
                }
            } else {
                return true
            }
        } else {
            return true
        }
    }

I could not solve the problem, please help me.
Thank you

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions