Surile / react-native-sunmi-printer

商米内置打印机
MIT License
47 stars 33 forks source link

NullPointerException on non-Sunmi devices #4

Closed alexsegura closed 2 years ago

alexsegura commented 2 years ago

Hi,

I'm using this library on all kind of devices, and I see this error from time to time on non-Sunmi devices.

NullPointerException
Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference
Capture d’écran 2022-03-08 à 16 16 12

It seems result may be null in this piece of code:

https://github.com/Surile/react-native-sunmi-printer/blob/22efbaef46cbe7f2984088bb7601a9264afbf64a/android/src/main/java/com/reactnativesunmiprinter/SunmiScanModule.java#L29-L40

Surile commented 2 years ago

@alexsegura Ok, let me see

alexsegura commented 2 years ago

If this can help, here is the "breadcrumb" of the issue. Seems related to some intent (?) sent by the Stripe library.

It makes sense, because our users are reporting problems when trying to pay by credit card.

Capture d’écran 2022-03-09 à 11 42 05
alexsegura commented 2 years ago

@Surile hi there, any news on this?

FYI, I hotfixed it in my fork with a simple check against null (https://github.com/alexsegura/react-native-sunmi-printer/commit/243c96e54986fb98a8265798e9fbd7f0bfb8f7a9)

Should I submit it as a pull request?

Surile commented 2 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

OK。

                            小欣

                                ***@***.***

    签名由
    网易邮箱大师
    定制

On 03/30/2022 20:01,Alexandre ***@***.***> wrote: 

@Surile hi there, any news on this? FYI, I hotfixed it in my fork with a simple check against null @.***) Should I submit it as a pull request?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

alexsegura commented 2 years ago

@Surile here it is --> #5

alexsegura commented 2 years ago

Thanks for merging 🤝

Can you please make a new release? Thanks 🙂

Surile commented 2 years ago

@alexsegura Yes, hold on

alexsegura commented 2 years ago

@Surile sorry to bother you again, but even if I see the release, the update seems to be unavailable. Maybe you need to publish it on NPM?

Capture d’écran 2022-03-31 à 15 12 49
Surile commented 2 years ago

@alexsegura Sorry the release failed, I have reposted it