diff --git a/packages/edit-site/src/components/post-edit/index.js b/packages/edit-site/src/components/post-edit/index.js index 0ec63589d97673..8d7e09c702047e 100644 --- a/packages/edit-site/src/components/post-edit/index.js +++ b/packages/edit-site/src/components/post-edit/index.js @@ -65,13 +65,18 @@ function PostEditForm( { postType, postId } ) { const onChange = ( edits ) => { for ( const id of ids ) { if ( + edits.status && edits.status !== 'future' && record.status === 'future' && new Date( record.date ) > new Date() ) { edits.date = null; } - if ( edits.status === 'private' && record.password ) { + if ( + edits.status && + edits.status === 'private' && + record.password + ) { edits.password = ''; } editEntityRecord( 'postType', postType, id, edits );