From 7bc830da4fb137aa5d1448ad0d3096220de6af4e Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Mon, 3 Oct 2016 12:00:19 +0200 Subject: [PATCH] [Escher] The TextView handles the case where its text is nullptr Change-Id: I358b893ab64ee969f41b4f6f0df0ca6a37201de3 --- escher/src/text_view.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/escher/src/text_view.cpp b/escher/src/text_view.cpp index 09a6023f2..00b0ceab2 100644 --- a/escher/src/text_view.cpp +++ b/escher/src/text_view.cpp @@ -36,6 +36,9 @@ void TextView::setAlignment(float horizontalAlignment, float verticalAlignment) } void TextView::drawRect(KDContext * ctx, KDRect rect) const { + if (m_text == nullptr) { + return; + } KDSize textSize = KDText::stringSize(m_text); KDPoint origin = { (KDCoordinate)(m_horizontalAlignment*(m_frame.width() - textSize.width())),