-
Notifications
You must be signed in to change notification settings - Fork 120
Open

Description
IntelliJ IDEA shows that the following line has a potential fault (script
can be null
and subsequently dereferenced):
jlatexmath/jlatexmath/src/main/java/org/scilab/forge/jlatexmath/OverUnderBox.java
Line 96 in e1bcaa3
+ (!over && script != null ? script.height + script.depth + kern : 0); |
Whether that fault is ever realized I haven't explored. Here's the fix I added to KeenTeX:
public OverUnderBox( Box b, Box d, Box script, float kern, boolean over ) {
base = b;
del = d;
this.script = script;
this.kern = kern;
this.over = over;
// Kerned height.
final var kh = script == null ? 0 : script.height + script.depth + kern;
// calculate metrics of the box
width = b.getWidth();
height = b.height
+ (over ? d.getWidth() : 0)
+ (over && script != null ? kh : 0);
depth = b.depth
+ (over ? 0 : d.getWidth())
+ (!over && script == null ? 0 : kh);
}
Metadata
Metadata
Assignees
Labels
No labels