Commit e4cf57c
Check if layer exists before looking for objects
Changed files (2)
Diff
@@ -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 file@@ -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