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

NPE in MediaDescription#setAttribute() because CandidateAttribute#attribute is null #19

Open
GoogleCodeExporter opened this issue Feb 17, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
- Create Agent and add audio stream, likle in test/ICE.java
- call IceSdpUtils#initSessionDescription()
- get 1st MediaDescription from new SessionDescription
- call MediaDescription.setAttribute("foo", "bar");

    Exception in thread "main" java.lang.NullPointerException
        at gov.nist.javax.sdp.MediaDescriptionImpl.setAttribute(MediaDescriptionImpl.java:505)

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

Original issue reported on code.google.com by [email protected] on 5 Nov 2013 at 1:13

@GoogleCodeExporter
Copy link
Author

From 36789bee673cfc56fa6f2bb40801147c48a502e2 Mon Sep 17 00:00:00 2001
From: Ilya Basin <[email protected]>
Date: Fri, 8 Nov 2013 11:12:31 +0400
Subject: [PATCH] fix NPE in MediaDescription#setAttribute() because
 CandidateAttribute#attribute is null

http://code.google.com/p/ice4j/issues/detail?id=19
---
 src/org/ice4j/ice/sdp/CandidateAttribute.java |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/org/ice4j/ice/sdp/CandidateAttribute.java 
b/src/org/ice4j/ice/sdp/CandidateAttribute.java
index 35943de..7b2435a 100644
--- a/src/org/ice4j/ice/sdp/CandidateAttribute.java
+++ b/src/org/ice4j/ice/sdp/CandidateAttribute.java
@@ -38,6 +38,7 @@ public class CandidateAttribute extends AttributeField
     public CandidateAttribute(Candidate candidate)
     {
         this.candidate = candidate;
+        this.attribute = new NameValue(NAME, null);
     }

     /**
-- 
1.7.9

Original comment by [email protected] on 14 Nov 2013 at 2:41

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

No branches or pull requests

1 participant