The candidate didn't previously have the option to automatically translate to JSON - see the XXX comment a few lines above. When all versions of FF we support have the fix then we can simplify it.

Romain Gauthier <notifications@github.com> wrote:
>> -    // The last candidate event is a null event, so we don't need to
>do
>> -    // anything with that.
>> -    if (event && event.candidate) {
>> -      this.trigger('ice:candidate-ready', {
>> -        candidate: event.candidate.candidate,
>> -        sdpMid: event.candidate.sdpMid,
>> -        sdpMLineIndex: event.candidate.sdpMLineIndex
>> -      });
>> +    // The last candidate event is a null event, we let this be
>transmitted
>> +    // to the SPA, and possibly the other side as this allows the
>SPA to
>> +    // reconstruct ICE candidates into the SDP in the case of the SP
>not
>> +    // supporting trickle ICE.
>> +    if (event) {
>> +      this.trigger('ice:candidate-ready',
>> +        event.candidate ? {
>> +          candidate: event.candidate.candidate,
>
>Is `event.candidate.candidate` not supposed to be an opaque data
>structure ? Why not having `event.candidate ? event.candidate :
>undefined` ?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/mozilla/talkilla/pull/288/files#r7340657

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.