The Birdfont Source Code


All Repositories / birdfont.git / commit – 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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 15 Aug 2017 14:53:17 +0000 (16:53 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 15 Aug 2017 14:53:17 +0000 (16:53 +0200)
commit a9b7124068761ae7e8b0acf3e8288a385f2d282d
tree 1c607b62b2273780415f71556dce79f720ea19d4
parent 7820cb31f341dabd0a73088027a6393b7d40e5a6
Fix non null variables at compile time

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 @@ } } -