Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle nil backgroundColor in ASTextNode2 #trivial #841

Merged
merged 2 commits into from
Mar 17, 2018

Conversation

maicki
Copy link
Contributor

@maicki maicki commented Mar 16, 2018

No description provided.

};
@"container": copiedContainer,
@"text": mutableText,
@"bgColor": self.backgroundColor ?: [NSNull null]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Adlai-Holler Let me know if we should do more like:

if (self.backgroundColor) {
  return @{
   @"container": copiedContainer,
    @"text": mutableText,
    @"bgColor": self.backgroundColor
  }
}

  return @{
   @"container": copiedContainer,
    @"text": mutableText
  }

And remove the NSNull check in the display method.

Copy link
Member

@appleguy appleguy left a comment

Choose a reason for hiding this comment

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

Thanks for the super quick fix! I think it's OK to use NSNull here, although I suppose the other check wouldn't be needed with the if() fix, so it's a toss-up.

@ghost
Copy link

ghost commented Mar 17, 2018

1 Warning
⚠️ Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.

Generated by 🚫 Danger

@maicki maicki changed the title Handle nil backgroundColor in ASTextNode2 Handle nil backgroundColor in ASTextNode2 #trivial Mar 17, 2018
@appleguy appleguy merged commit 0b10113 into master Mar 17, 2018
@appleguy appleguy deleted the MSHandleNullBackgroundColorTextNodeTwo branch March 17, 2018 03:08
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
* Handle nil backgroundColor

* Small improvement
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.

None yet

2 participants