check for existing model before updating it and fixed typo

This commit is contained in:
Martin Lippert
2018-06-08 16:06:48 +02:00
parent 2353b43fa3
commit e157343daa
2 changed files with 10 additions and 8 deletions

View File

@@ -183,7 +183,7 @@ public class LiveBeansModel {
for (Exception e : exceptions) {
Log.log(e);
}
return LiveBeansModel.builder().build(); // allways return at least an empty model.
return LiveBeansModel.builder().build(); // always return at least an empty model.
}
private final ImmutableListMultimap<String, LiveBean> beansViaType;

View File

@@ -44,13 +44,15 @@ public class ChangeHistory {
Change result = null;
LiveBeansModel currentBeans = this.runningProcess.getBeans();
if (lastBeans == null) {
lastBeans = currentBeans;
}
else if (currentBeans != null) {
result = calculateBeansDiff(lastBeans, currentBeans, result);
lastBeans = currentBeans;
if (!currentBeans.isEmpty()) {
if (lastBeans == null) {
lastBeans = currentBeans;
}
else if (lastBeans != null && currentBeans != null) {
result = calculateBeansDiff(lastBeans, currentBeans, result);
lastBeans = currentBeans;
}
}
return result;