#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("---")) { if (strings[i].startsWith("---")) {
i++; i++;
} else { } else {
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]); if (lineChange.getLineFrom() == null) {
i++; 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("+++")) { if (strings[i].startsWith("+++")) {
i++; i++;
} else { } else {
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]); if (lineChange.getLineTo() == null) {
i++; lineChange.setLineTo(strings[i]);
i++;
} else {
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
i++;
}
} }
} }
} }