Skip to content
Snippets Groups Projects
Commit d28b6eb5 authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

fixed null pointer exception for languages other than Event-B

parent b74df020
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.TableColumn;
import de.prob.core.Animator;
import de.prob.core.domainobjects.History;
import de.prob.core.domainobjects.HistoryItem;
import de.prob.core.domainobjects.MachineDescription;
import de.prob.core.domainobjects.Operation;
import de.prob.core.domainobjects.State;
import de.prob.exceptions.ProBException;
......@@ -113,16 +114,20 @@ public class HistoryView extends StateBasedViewPart {
private void createColumns(final Composite composite) {
final Animator animator = Animator.getAnimator();
final String[] events = animator.getMachineDescription()
MachineDescription machineDescription = animator.getMachineDescription();
String[] models = new String[0];
if (machineDescription != null) {
models = machineDescription
.getModelNames().toArray(new String[0]);
ArrayUtils.reverse(events);
ArrayUtils.reverse(models);
}
final TableColumnLayout layout = new TableColumnLayout();
composite.setLayout(layout);
if (events.length > 0) {
if (models.length > 0) {
int pos = 0;
for (final String event : events) {
for (final String model : models) {
final boolean isFirst = pos == 0;
createColumn(layout, event, new HistoryEventLabelProvider(pos),
createColumn(layout, model, new HistoryEventLabelProvider(pos),
isFirst);
pos++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment