Clone in a terminal:
Commit 9b3cf14
Johan Mattsson - 2024-09-16T09:14:58+00:00
9b3cf14147e38fc5da2605ec986d0fcdaa42be9djohan.mattsson.m@gmail.com

Don't crash when no subgroup is available

Changed files (1)

Diff

diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 0f44f96..aa42b06 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -1141,12 +1141,17 @@ public class Glyph : FontDisplay {  		var subgroups = get_current_layer ().subgroups; 		-		if (is_null(subgroups)) {+		if (is_null (subgroups)) { 			warning ("Expecting a sub group."); 			return null; 		}  		foreach (Layer layer in subgroups) {+			if (is_null (layer.paths) || is_null (layer.paths.paths)) {+				warning ("No paths in get_path_at");+				continue;+			}+			 			foreach (Path pt in layer.paths.paths) { 				if (pt.is_over (x, y)) { 					found = true;@@ -1158,7 +1163,7 @@ public class Glyph : FontDisplay { 		if (!found) { 			var current_layer_paths = get_paths_in_current_layer (); 		-			if (is_null(current_layer_paths)) {+			if (is_null (current_layer_paths)) { 				warning ("Expecting current_layer_paths."); 				return null;		 			}@@ -2491,4 +2496,4 @@ public class Glyph : FontDisplay { 	} } -}\ No newline at end of file+}

Contact

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