#26-Removing null from lineChange

This commit is contained in:
BarminaA 2021-04-24 19:23:44 +04:00
parent 4629562e0f
commit fb04c3bb1d

View File

@ -251,8 +251,13 @@ public class GitRepositoryService {
if (strings[i].startsWith("---")) {
i++;
} else {
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
i++;
if (lineChange.getLineFrom() == null) {
lineChange.setLineFrom(strings[i]);
i++;
} else {
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
i++;
}
}
}
}
@ -261,8 +266,13 @@ public class GitRepositoryService {
if (strings[i].startsWith("+++")) {
i++;
} else {
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
i++;
if (lineChange.getLineTo() == null) {
lineChange.setLineTo(strings[i]);
i++;
} else {
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
i++;
}
}
}
}