Clone in a terminal:
Commit e4cf57c
Johan Mattsson - 2023-10-07T02:52:59+00:00
e4cf57c4dda7a1b6f072db9f2d424fa3ba6fcfd9johan.mattsson.m@gmail.com

Check if layer exists before looking for objects

Changed files (2)

Diff

diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex dc02763..0f44f96 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -1139,7 +1139,14 @@ public class Glyph : FontDisplay { 		Layer? group = null; 		bool found = false; -		foreach (Layer layer in get_current_layer ().subgroups) {+		var subgroups = get_current_layer ().subgroups;+		+		if (is_null(subgroups)) {+			warning ("Expecting a sub group.");+			return null;+		}++		foreach (Layer layer in subgroups) { 			foreach (Path pt in layer.paths.paths) { 				if (pt.is_over (x, y)) { 					found = true;@@ -1149,7 +1156,14 @@ public class Glyph : FontDisplay { 		}  		if (!found) {-			foreach (Path pt in get_paths_in_current_layer ()) {+			var current_layer_paths = get_paths_in_current_layer ();+		+			if (is_null(current_layer_paths)) {+				warning ("Expecting current_layer_paths.");+				return null;		+			}+		+			foreach (Path pt in current_layer_paths) { 				if (pt.is_over (x, y)) { 					Layer layer = new Layer (); 					layer.is_counter = true;@@ -2477,4 +2491,4 @@ public class Glyph : FontDisplay { 	} } -}+}\ No newline at end of filediff --git a/scripts/version.py b/scripts/version.pyindex 8d94115..4e9dc5f 100644--- a/scripts/version.py+++ b/scripts/version.py@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. """ -VERSION = '2.33.2'+VERSION = '2.33.3' SO_VERSION_MAJOR = '36' SO_VERSION_MINOR = '0' SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR

Contact

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