looneyapurv / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

Conditional braces missing after if in SipRequest.js #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a SIP request of type PUBLISH with Event header in a web client
2.On sending the SIP PUBLISH request from client, error appears in browser 
console

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

In the if condition on live 177, in SIPRequest.js file.

--------------------------------------------------
 } else if (this.getMethod()==this.PUBLISH) {
        if (this.getHeader(this.EventHeader) == null)
            console.error("SIPRequest:checkHeaders(): "+prefix + this.EventHeader);
            throw "SIPRequest:checkHeaders(): "+prefix + this.EventHeader;
---------------------------------------------------

There should be braces after - if (this.getHeader(this.EventHeader) == null) 
such as 

---------------------------------------------------

} else if (this.getMethod()==this.PUBLISH) {
        if (this.getHeader(this.EventHeader) == null){
            console.error("SIPRequest:checkHeaders(): "+prefix + this.EventHeader);
            throw "SIPRequest:checkHeaders(): "+prefix + this.EventHeader;
            }
-----------------------------------------------------

otherwise the code throws error irrespective of anything;even if the PUBLISH 
request does have a valid Event header.

Original issue reported on code.google.com by hvardh...@gmail.com on 4 Jun 2013 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by jean.deruelle on 4 Jul 2013 at 8:15

GoogleCodeExporter commented 9 years ago

Original comment by laurent.strullu.orange@gmail.com on 4 Jul 2013 at 9:46