Skip to content

Commit

Permalink
#1054 | Fix icon fetching when url is blank string instead of empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Suhas Vishwanath committed Oct 3, 2023
1 parent 6fe8b9c commit ef00f35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/formDesigner/components/ReportCard/ReportCardShow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import http from "../../../common/utils/httpClient";
import RuleDisplay from "../../../adminApp/components/RuleDisplay";
import { connect } from "react-redux";
import { Privilege } from "openchs-models";
import * as _ from "lodash";

const ReportCardShow = props => {
const RenderCard = ({ card }) => {
Expand All @@ -27,7 +28,7 @@ const ReportCardShow = props => {
}, [card.standardReportCardTypeId]);

React.useEffect(() => {
if (card.iconFileS3Key != null) {
if (!_.isNil(card.iconFileS3Key) && !_.isEmpty(card.iconFileS3Key)) {
http
.get(http.withParams(`/media/signedUrl`, { url: card.iconFileS3Key }))
.then(res => res.data)
Expand Down

0 comments on commit ef00f35

Please sign in to comment.