File tree 1 file changed +6
-2
lines changed
src/main/kotlin/com/jetbrains/gateway/sdk/convertors
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,19 @@ import dev.onvoid.webrtc.RTCSdpType
7
7
import dev.onvoid.webrtc.RTCSessionDescription
8
8
9
9
class RTCSessionDescriptionAdapter : TypeAdapter <RTCSessionDescription >() {
10
- override fun write (writer : JsonWriter , sessionDescription : RTCSessionDescription ) {
10
+ override fun write (writer : JsonWriter , sessionDescription : RTCSessionDescription ? ) {
11
+ if (sessionDescription == null ) {
12
+ writer.nullValue()
13
+ return
14
+ }
11
15
writer.beginObject()
12
16
writer.name(" type" ).value(sessionDescription.sdpType.name.toLowerCase())
13
17
writer.name(" sdp" ).value(sessionDescription.sdp)
14
18
writer.endObject()
15
19
}
16
20
17
21
override fun read (reader : JsonReader ): RTCSessionDescription {
18
- var sdpType = 0 ;
22
+ var sdpType = 0
19
23
var sdp: String? = null
20
24
reader.beginObject()
21
25
while (reader.hasNext()) {
You can’t perform that action at this time.
0 commit comments