finos/FDC3-Sail

getCurrentChannel fails if there is no current channel

Closed this issue · 1 comments

Bug Report

Steps to Reproduce:

Run conformance test getCurrentChannel (FDC31.2)

Expected Result:

Promise of null

Actual Result:

Exception thrown;

Additional Context:

 getCurrentChannel: async () => {
      const result: ChannelData = await sendMessage(
        FDC3_1_2_TOPICS.GET_CURRENT_CHANNEL,
        {},
      );

      return createChannelObject(
        result.id,
        result.type,
        result.displayMetadata || { name: result.id },
      );
    },

in the above code from api.ts, result is null but nevertheless it tries to create a channel object.

I might try and fix this later if I have time.