The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix non null variables at compile time

These changes was commited to the Birdfont repository Tue, 15 Aug 2017 14:53:17 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Tue, 15 Aug 2017 14:53:17 +0000]

Updated Files

libbirdfont/GlyphSequence.vala
--- a/libbirdfont/GlyphSequence.vala +++ b/libbirdfont/GlyphSequence.vala @@ -222,11 +222,19 @@ public string to_string () { StringBuilder s = new StringBuilder(); - foreach (Glyph g in glyph) { - if (g.unichar_code == '\0') { - s.append(@"[$(g.name)]"); + foreach (Glyph? g in glyph) { + + if (g != null) { + Glyph gl = (!) g; + + if (gl.unichar_code == '\0') { + s.append(@"[$(gl.name)]"); + } else { + string unichar_code = (!) gl.unichar_code.to_string (); + s.append(unichar_code); + } } else { - s.append(@"$((!) g.unichar_code)"); + s.append(@"[null]"); } } @@ -235,4 +243,3 @@ } } -