zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
92 stars 48 forks source link

Quick fix needed on error handling when calling modem.checkPINRequired #41

Closed jaydenpung closed 4 years ago

jaydenpung commented 5 years ago

In modem.js, there is a call to modem.checkPINRequired where the error is not handled properly:

modem.checkPINRequired((result, error) => {
    if (!error && result.data.pinNeeded && modem.pin.length) {

If there is an error, the 'result' will be '{error: "ERROR", request: "checkPINRequired", status: "Error"}', where as the second parameter 'error' will be null. Checking for error and result.data.pinNeeded at the same time caused issue (calling pinNeeded on null).

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Apollon77 commented 5 years ago

should be fixed

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Apollon77 commented 5 years ago

should be fixed

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Apollon77 commented 4 years ago

Pong

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Apollon77 commented 4 years ago

llaaaaaa

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Apollon77 commented 4 years ago

and again

Apollon77 commented 4 years ago

@zabsalahid Reopen please