jenly1314 / WeChatQRCode

⛄ 基于OpenCV开源的微信二维码引擎移植的二维码扫码识别库
https://jenly1314.github.io/WeChatQRCode/
Apache License 2.0
607 stars 120 forks source link

WeChatQRCodeDetector中的空指针问题 #12

Closed sqbfine closed 1 year ago

sqbfine commented 2 years ago
private static String getExternalFilesDir(Context context,String path) {
        File[] files = context.getExternalFilesDirs(path);
        if(files!=null && files.length > 0){
            return files[0].getAbsolutePath();
        }
        return context.getExternalFilesDir(path).getAbsolutePath();

    }

其中files[0]可能为空,建议修复一下

jenly1314 commented 2 years ago

没有内置的外部存储卡?

sqbfine commented 2 years ago

嗯,只是一种可能的情况,建议还是优化一下