ailiwean / NBZxing

🔥 2020年最好用的开源扫码,全方位优化,强烈推荐!! 支持多种常规zxing无法扫出的码,用就完了!! 🔥
MIT License
300 stars 55 forks source link

'java.lang.String com.ailiwean.core.zxing.core.Result.getText()on a null object reference #49

Open panruifeng1990 opened 2 years ago

panruifeng1990 commented 2 years ago

ava.lang.NullPointerException

Attempt to invoke virtual method 'java.lang.String com.ailiwean.core.zxing.core.Result.getText()' on a null object reference

com.ailiwean.core.able.XQRScanAble.com.ailiwean.core.Result covertResult(com.ailiwean.core.zxing.core.Result)(XQRScanAble.java:41)

这里为什么回是空

panruifeng1990 commented 2 years ago

跟换版本0.2.2试试

panruifeng1990 commented 2 years ago

api 'com.github.ailiwean:NBZxing:0.2.4' api 'com.github.ailiwean:NBZxing-Scale:0.0.6' 使用最新版本仍有问题

panruifeng1990 commented 2 years ago

@ailiwean 你好作者,使用最新的线上仍然有bugly统计出此问题

panruifeng1990 commented 2 years ago

//看代码都做了处理为啥还有这个问题 真奇葩 有知道的吗

protected void needParseDeploy(PlanarYUVLuminanceSource source, boolean isNative) {
    if (result != null && result.getText() != null)
        return;
    result = toLaunchParse(source.getHybridBinary());
    if (result != null && result.getText() != null && !"".equals(result.getText())) {
        sendMessage(Config.RT_LOCATION,
                ScanHelper.rotatePoint(result.getResultPoints()));
        sendMessage(Config.SCAN_RESULT, covertResult(result));
    }
}

protected com.ailiwean.core.Result covertResult(Result result) {
    com.ailiwean.core.Result result_ = new com.ailiwean.core.Result();
    result_.setText(result.getText());
    PointF[] pointFS = ScanHelper.rotatePoint(result.getResultPoints());
    result_.setQrPointF(ScanHelper.calCenterPointF(pointFS));
    result_.setQrLeng(ScanHelper.calQrLenghtShow(result.getResultPoints()));
    result_.setFormat(result.getBarcodeFormat());
    result_.setQrRotate(ScanHelper.calQrRotate(pointFS));
    return result_;
}
ailiwean commented 2 years ago

@panruifeng1990 可能是多线程导致的, 你加我群细聊 github老是收不到消息

panruifeng1990 commented 2 years ago

好的 @ailiwean

kagurasansan commented 2 years ago

@panruifeng1990 问题解决了吗,我们也有出现崩溃

ailiwean commented 2 years ago

@kagurasansan 用新版试试