1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-07 02:40:52 +00:00

NPE protection

This commit is contained in:
Arnaud Roques 2022-01-07 19:12:07 +01:00
parent 24bd088e01
commit 9cba08f732

View File

@ -151,26 +151,13 @@ public class Emoji {
private void computeMinMaxGray() {
for (String s : data) {
if (s.contains("<path ")) {
final int gray = getGray(justExtractColor(s));
minGray = Math.min(minGray, gray);
maxGray = Math.max(maxGray, gray);
} else if (s.contains("</g>")) {
// Nothing
} else if (s.contains("<g>")) {
// Nothing
} else if (s.contains("<g ")) {
final int gray = getGray(justExtractColor(s));
minGray = Math.min(minGray, gray);
maxGray = Math.max(maxGray, gray);
} else if (s.contains("<circle ")) {
final int gray = getGray(justExtractColor(s));
minGray = Math.min(minGray, gray);
maxGray = Math.max(maxGray, gray);
} else if (s.contains("<ellipse ")) {
final int gray = getGray(justExtractColor(s));
minGray = Math.min(minGray, gray);
maxGray = Math.max(maxGray, gray);
if (s.contains("<path ") || s.contains("<g ") || s.contains("<circle ") || s.contains("<ellipse ")) {
final HColor color = justExtractColor(s);
if (color != null) {
final int gray = getGray(color);
minGray = Math.min(minGray, gray);
maxGray = Math.max(maxGray, gray);
}
} else {
// Nothing
}