Skip to content

Commit d31b25e

Browse files
authored
Merge pull request #23 from johnny77221/master
Fixes crash bug
2 parents 6e3c429 + 98a7ce6 commit d31b25e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/TweePlaceholderTextField.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,14 @@ open class TweePlaceholderTextField: UITextField {
286286
}
287287

288288
private func enablePlaceholderHeightConstraint() {
289+
// guard placeholderLayoutGuide.owningView != nil else { return }
289290
placeholderGuideHeightConstraint?.isActive = false
290291
placeholderGuideHeightConstraint = placeholderLayoutGuide.heightAnchor.constraint(equalTo: heightAnchor)
291292
placeholderGuideHeightConstraint?.isActive = true
292293
}
293294

294295
private func disablePlaceholderHeightConstraint() {
296+
guard placeholderLayoutGuide.owningView != nil else { return }
295297
placeholderGuideHeightConstraint?.isActive = false
296298
placeholderGuideHeightConstraint = placeholderLayoutGuide.heightAnchor.constraint(equalToConstant: 0)
297299
placeholderGuideHeightConstraint?.isActive = true

0 commit comments

Comments
 (0)