Omaha #3163 Fix NPE when styleless strings are sent to 14.3

Former-commit-id: 7245544e1f [formerly 3c1dd0e7daea7149a02b1a5e2be1a0db27e662d5]
Former-commit-id: 1f8f612d3a
This commit is contained in:
Ben Steffensmeier 2014-06-13 16:49:05 -05:00
parent cd10372371
commit d2997f9fc0

View file

@ -114,7 +114,6 @@ public class DrawStringEvent extends AbstractRemoteGraphicsRenderEvent {
@Deprecated
private RGB boxColor;
/**
* @deprecated Once backwards compatibility is not needed switch to
* {@link #textStyleColorMap}
@ -249,6 +248,9 @@ public class DrawStringEvent extends AbstractRemoteGraphicsRenderEvent {
.get(TextStyle.DROP_SHADOW);
}
}
} else if (!SUPPORT_STYLE_COLORS) {
/* No TextStyle 14.3 is an empty set, not null. */
this.textStyles = EnumSet.noneOf(TextStyle.class);
}
}
@ -267,9 +269,9 @@ public class DrawStringEvent extends AbstractRemoteGraphicsRenderEvent {
for (Entry<TextStyle, RGB> entry : textStyleColorMap.entrySet()) {
ds.addTextStyle(entry.getKey(), entry.getValue());
}
}else{
if(textStyles != null){
for(TextStyle style : textStyles){
} else {
if (textStyles != null) {
for (TextStyle style : textStyles) {
if (style.equals(TextStyle.BOXED)) {
ds.addTextStyle(style);
ds.addTextStyle(TextStyle.BLANKED, boxColor);
@ -280,6 +282,8 @@ public class DrawStringEvent extends AbstractRemoteGraphicsRenderEvent {
ds.addTextStyle(style);
}
}
} else {
System.out.println();
}
}
return ds;