Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jayrulez
Copy link
Contributor

@jayrulez jayrulez commented Aug 9, 2018

Prevent TextBlock from throwing null reference exception when WrapText is set to true and the value of text is null. Fixes issue#82

…t is set to true and the value of text is null. Fixes issue#82
{
if (text == null)
{
if (WrapText)
Copy link
Member

Choose a reason for hiding this comment

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

Not needed. The method is only called when that boolean is already true.


private void UpdateWrappedText(Vector3 availableSpace)
{
if (text == null)
Copy link
Member

Choose a reason for hiding this comment

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

Change it to string.IsNullOrEmpty(text). That will save some computation.

@Kryptos-FR
Copy link
Member

Thanks. LGTM

@xen2 xen2 merged commit b6d3e7d into stride3d:master Aug 9, 2018
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.

3 participants