Skip to content

Commit

Permalink
Null Case Handler for Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
basil-ahmed committed Nov 18, 2023
1 parent 1d21ebe commit 84fd439
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ const DesktopIssueDetails = ({ index }) => {
</div>

{/* Map through the comments and display them starting with Update 2 */}
{issue.comments.map((update, index) => (
{issue.comments[0] != null && (issue.comments.map((update, index) => (
<div key={index} className="update">
{/* Updates in Reverse */}
<h4>Update {issue.comments.length - index}</h4>
<p>{update}</p>
</div>
))}
)))}
</div>

<div className="add-comment">
Expand Down Expand Up @@ -248,7 +248,7 @@ const DesktopIssueDetails = ({ index }) => {
{issue.departments.map((dept, index) => <li className='issue-li department-pill' key={index}>{mapDepartmentToDisplayName(dept)}</li>)}
</ul>
</div>
{issue.attachments.length > 1 && (
{issue.attachments[0] != null && (
<div className="attachments">
<h3>Attachments</h3>
<ul className='attachment-box'>
Expand Down

0 comments on commit 84fd439

Please sign in to comment.