[fixed] Text box does not support null string (1 Viewer)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Someone have implemented a new property for Video informations : VideoStoryPlot

    It's a nice to have, but in CurrentPlayingDVD.xaml, this filed is mapped into a TextBox, and it seems a TextBox can't have a null text.

    So if I want to display the infos of my current movie, and if there's nothing into the DB/File for that, then the client crash.

    More precisely, it fails in FontAssetCore.cs at line 118 because text is null.

    Code:
        public float TextWidth(string text, float fontSize, bool kerning)
        {
          return PartialTextWidth(text, 0, text.Length - 1, fontSize, kerning) + CharWidthExtension(text, text.Length - 1, fontSize);
        }

    So, or the problem is in the skin engine and maybe it must not try to show a TextBox for a null text, or it's in the player.cs that must return an empty string in this case. But in the case of an empty string, it creates a not so nice empty white box...

    Cheers.

    Smeulf.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Ok fixed this morning.

    Question : why not to use a Label with Wrap="True" and Scroll="Auto" parameters instead, like for the field description in SlimTV current program informations ?

    'Cause I persist, this white box is not nice in this case, and it can be edited, without saving possibilities.

    Cheers.
     

    Users who are viewing this thread

    Top Bottom