Skip to content

Commit

Permalink
fix: media lib asset.formats null check
Browse files Browse the repository at this point in the history
  • Loading branch information
lkho authored Jun 16, 2022
1 parent 6ae0bd6 commit 6f5cdc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/src/components/CKEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ const Editor = ({ onChange, name, value, disabled }) => {
let newValue = value ? value : "";
assets.map((asset) => {
if (asset.mime.includes("image")) {
if (uploadCfg?.responsiveDimensions) {
if (asset.formats?.length && uploadCfg?.responsiveDimensions) {
let set = "";
let keys = Object.keys(asset.formats).sort((a, b) => {
return asset.formats[a].width - asset.formats[b].width;
});
keys?.map((k) => {
keys.map((k) => {
let str =
prefixFileUrlWithBackendUrl(asset.formats[k].url) + ` ${asset.formats[k].width}w,`;
set = set + str;
Expand Down

0 comments on commit 6f5cdc6

Please sign in to comment.