Skip to content

Commit

Permalink
Fix: Shadow/Font size preset panel crashes the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Oct 1, 2024
1 parent 40ceb00 commit d467684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function FontSize() {

const [ globalFluid ] = useGlobalSetting( 'typography.fluid' );

if ( ! origin || ! slug ) {
return null;
}

// Get the font sizes from the origin, default to empty array.
const sizes = fontSizes[ origin ] ?? [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export default function ShadowsEditPanel() {
const [ isRenameModalVisible, setIsRenameModalVisible ] = useState( false );
const [ shadowName, setShadowName ] = useState( selectedShadow.name );

if ( ! category || ! slug ) {
return null;
}

const onShadowChange = ( shadow ) => {
setSelectedShadow( { ...selectedShadow, shadow } );
const updatedShadows = shadows.map( ( s ) =>
Expand Down

0 comments on commit d467684

Please sign in to comment.