diff --git a/src/Gtk/Perspex.Cairo/Media/FormattedTextImpl.cs b/src/Gtk/Perspex.Cairo/Media/FormattedTextImpl.cs index 160e6e04b4..4a4ec5002a 100644 --- a/src/Gtk/Perspex.Cairo/Media/FormattedTextImpl.cs +++ b/src/Gtk/Perspex.Cairo/Media/FormattedTextImpl.cs @@ -25,7 +25,7 @@ namespace Perspex.Cairo.Media FontWeight fontWeight) { Contract.Requires(context != null); - + Contract.Requires (text != null); Layout = new Pango.Layout(context); _text = text; Layout.SetText(text); diff --git a/src/Perspex.SceneGraph/Media/FormattedText.cs b/src/Perspex.SceneGraph/Media/FormattedText.cs index b8e8c5ddee..f5f390c609 100644 --- a/src/Perspex.SceneGraph/Media/FormattedText.cs +++ b/src/Perspex.SceneGraph/Media/FormattedText.cs @@ -29,6 +29,9 @@ namespace Perspex.Media TextAlignment textAlignment, FontWeight fontWeight) { + //TODO: Find out why it was null in the first place. Demo project - AvalonStudio + //https://github.com/VitalElement/AvalonStudio/commit/787fb9396feb74e6ca6bd4e08436269a349df9c6 + text = text ?? ""; Text = text; FontFamilyName = fontFamilyName; FontSize = fontSize;