Clone in a terminal:
Commit a9b7124
Johan Mattsson - 2017-08-15T14:53:17+00:00
a9b7124068761ae7e8b0acf3e8288a385f2d282djohan.mattsson.m@gmail.com

Fix non null variables at compile time

Changed files (1)

Diff

diff --git a/libbirdfont/GlyphSequence.vala b/libbirdfont/GlyphSequence.valaindex 805f3e2..b31e3e4 100644--- a/libbirdfont/GlyphSequence.vala+++ b/libbirdfont/GlyphSequence.vala@@ -222,11 +222,19 @@ public class GlyphSequence : GLib.Object {  	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]"); 			} 		} @@ -234,4 +242,4 @@ public class GlyphSequence : GLib.Object { 	} } -}+}\ No newline at end of file

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112