aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-03 05:01:29 +0100
committerSven Göthel <[email protected]>2024-02-03 05:01:29 +0100
commit8fcbeaa4e440e1bb8e51658f15a35d2a217dc0bc (patch)
treeb704f7d7d333ffec5c08112aa91806b4d651a06e
parent5acc02aee010d0bae0186bf906bd0c5e8abfb948 (diff)
Typecast: Re-apply overwritten stability changes (NPE, redundancy)
0e5e38478a6197b2dc65960c55bc831d6b4796a7 Sun Feb 12 00:54:40 2023 +0100 d18df847b17a89fdc4b47fa9cfe010af1a61690b Sat Mar 1 16:48:48 2014 +0100
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index 0979c6c8f..d0b2da2b7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -176,7 +176,8 @@ public class GlyfCompositeDescript extends GlyfDescript {
@Override
public int getContourCount() {
final GlyfCompositeComp last = lastComponent();
- return last.getFirstContour() + getReferencedGlyph(last).getContourCount();
+ final GlyfDescript lastD = getReferencedGlyph(last);
+ return last.getFirstContour() + ( null != lastD ? lastD.getContourCount() : 0 );
}
private GlyfCompositeComp lastComponent() {
@@ -206,24 +207,24 @@ public class GlyfCompositeDescript extends GlyfDescript {
}
private GlyfCompositeComp getCompositeComp(final int i) {
- GlyfCompositeComp c;
- for (final GlyfCompositeComp component : _components) {
- c = component;
+ for (final GlyfCompositeComp c : _components) {
final GlyphDescription gd = getReferencedGlyph(c);
- if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) {
- return c;
+ if( null != gd ) {
+ if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) {
+ return c;
+ }
}
}
return null;
}
private GlyfCompositeComp getCompositeCompEndPt(final int i) {
- GlyfCompositeComp c;
- for (final GlyfCompositeComp component : _components) {
- c = component;
+ for (final GlyfCompositeComp c : _components) {
final GlyphDescription gd = getReferencedGlyph(c);
- if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) {
- return c;
+ if( null != gd ) {
+ if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) {
+ return c;
+ }
}
}
return null;