Add check for null 'endorsed_by' in discussion requested_fields=profile_image

Description

Logically if endorsed=True then 'endorsed_by' should not be null.
But due to old discussion data in both stage and prod; the api is crashing if above is not satisfied.

We need to ad an additional check to skip any null 'endorsed_by'.

Steps to Reproduce

None

Reason for Variance

None

Release Notes

None

Assignee

Wajeeha Khalid

Reporter

Wajeeha Khalid

Labels

None

Customer

None

URL

None

Groups with Read-Only Access

None

Actual Points

None

Reach

None

Impact

None

Open edX Discourse Thread

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Contributor Name

None

Blended Project Status Page

None

Story Points

0.5

Epic Link

Sprint

None

Priority

CAT-2
Configure