Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if getScts exists and is a function #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mejuliver
Copy link

error: TypeError: message.getScts is not a function
trace: /lib/functions/modem.js line 1589
solution: check first if "getScts" exist on the message obj and must be type function

error: TypeError: message.getScts is not a function
trace: /lib/functions/modem.js line 1589
solution: check first if "getScts" exist on the message obj and must be type function
@@ -163,7 +163,7 @@ module.exports = function(SerialPort) {
resultData.data = self.arrangeMessages(resultData.data)
modem.emit('onNewMessageIndicator', resultData)
modem.emit('onNewMessage', resultData.data[resultData.data.length - 1])
if (modem.autoDeleteOnReceive) {
if (modem.autoDeleteOnReceive && typeof message != 'undefined' ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (modem.autoDeleteOnReceive && typeof message != 'undefined' ) {
if (modem.autoDeleteOnReceive && typeof message !== 'undefined' ) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

äääähhmm .... where does "message" come from? or am I blind? There is no message initialized in this block ... ?!?

@Apollon77
Copy link
Contributor

Honestly ... I'm nit that sure because the interesting topic would be to understand WHY it is no function ... and in the other case WHY message is undefined zto make sure it is not a "flow" topic

@Apollon77
Copy link
Contributor

Can you please provide a logging or more details in whcih cases these issues happened ?

@Apollon77
Copy link
Contributor

@mejuliver Plese check if the issue still occurs in 4.0.1

@Apollon77
Copy link
Contributor

@zabsalahid I would close this PR because no reaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants