Skip to content

Commit

Permalink
fix post meta access
Browse files Browse the repository at this point in the history
  • Loading branch information
torounit committed May 19, 2022
1 parent 5bb7fe9 commit 44258a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/editor/components/DatetimeControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export const DatetimeControl = ( {
};

const updateDatetime = ( datetime: string ) => {
const otherItems = meta.schedule_terms?.filter( ( item ) => {
const otherItems = meta?.schedule_terms?.filter( ( item ) => {
return !(
item.term === term && item.type === type
);
} );
} ) || [];
setMeta( {
...meta,
schedule_terms: [
Expand All @@ -105,7 +105,7 @@ export const DatetimeControl = ( {
};

const getDatetime = ( format = TIMEZONELESS_FORMAT ) => {
const val = meta.schedule_terms?.find( ( item ) => {
const val = meta?.schedule_terms?.find( ( item ) => {
return item.term === term && item.type === type;
} );

Expand Down

0 comments on commit 44258a6

Please sign in to comment.