I'm retrieving data from an API using fetch which I'm storing within the variable 'data'
This is then being mapped to 'character' which I'm adding to my react component
</Typography>
<Grid container spacing={3}>
{data.map((character) => (
<Grid item xs={12} sm={4} key={character.id}>
<Card className={classes.card}>
<CardMedia
className={classes.media}
image={character.image_preview_url}
/>
<CardContent>
<Typography color="primary" variant="h5">
{character.name}
</Typography>
<Typography color="textSecondary" variant="subtitle2">
{character.owner.user.username}
</Typography>
I'm getting the issue on line {character.owner.user.username} because not every record in the returned data will contain a value for this item. How can I set the default to show as "No User" for when the value is returned as NULL ?