Skip to content

Conversation

@ephox-mogran
Copy link
Contributor

@ephox-mogran ephox-mogran commented Nov 1, 2017

Description

Guards against null values before calling properies

Fix for #3275

How Has This Been Tested?

Manually

Screenshots (jpeg or gifs if applicable):

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

// Generate the wrapper class names handling the different states of the block.
const { isHovered, isSelected, isMultiSelected, isFirstMultiSelected, focus } = this.props;
const showUI = isSelected && ( ! this.props.isTyping || focus.collapsed === false );
const showUI = isSelected && ( ! this.props.isTyping || ( focus && focus.collapsed === false ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor / unrelated: Do we need to check that this is explicitly false, or could we simplify to ! focus.collapsed ?

@mcsf mcsf force-pushed the fix/collapsed-null-bug branch from 7090252 to 50660df Compare November 2, 2017 09:00
@mcsf
Copy link
Contributor

mcsf commented Nov 2, 2017

Rebased after merging #3297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants