added string empty checks.

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-03-14 18:49:21 -05:00
parent 849dc0a7b9
commit 60f71a7709

View File

@ -286,7 +286,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
private func styleText(_ newValue: String!) {
defer { invalidateIntrinsicContentSize() }
guard let newValue else {
guard let newValue, !newValue.isEmpty else {
// We don't need to use attributed text
super.attributedText = nil
super.text = newValue
@ -311,7 +311,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
private func styleAttributedText(_ newValue: NSAttributedString?) {
defer { invalidateIntrinsicContentSize() }
guard let newValue = newValue else {
guard let newValue, !newValue.string.isEmpty else {
// We don't need any additional styling
super.attributedText = newValue
return