Index: /trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieBasedModel.java
===================================================================
--- /trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieBasedModel.java	(revision 251)
+++ /trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieBasedModel.java	(revision 252)
@@ -4,4 +4,5 @@
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
@@ -104,4 +105,7 @@
 	 */
 	public void update(Collection<List<Event<?>>> sequences) {
+		if (sequences == null) {
+			return;
+		}
 		if (trie == null) {
 			trie = new Trie<Event<?>>();
@@ -125,29 +129,30 @@
 	public List<? extends Event<?>> randomSequence() {
 		List<Event<?>> sequence = new LinkedList<Event<?>>();
-
-		IncompleteMemory<Event<?>> context = new IncompleteMemory<Event<?>>(
-				trieOrder - 1);
-		context.add(Event.STARTEVENT);
-
-		Event<?> currentState = Event.STARTEVENT;
-
-		boolean endFound = false;
-
-		while (!endFound) {
-			double randVal = r.nextDouble();
-			double probSum = 0.0;
-			List<Event<?>> currentContext = context.getLast(trieOrder);
-			for (Event<?> symbol : trie.getKnownSymbols()) {
-				probSum += getProbability(currentContext, symbol);
-				if (probSum >= randVal) {
-					endFound = (symbol == Event.ENDEVENT);
-					if (!(symbol == Event.STARTEVENT || symbol == Event.ENDEVENT)) {
-						// only add the symbol the sequence if it is not START
-						// or END
-						context.add(symbol);
-						currentState = symbol;
-						sequence.add(currentState);
+		if( trie!=null ) {
+			IncompleteMemory<Event<?>> context = new IncompleteMemory<Event<?>>(
+					trieOrder - 1);
+			context.add(Event.STARTEVENT);
+	
+			Event<?> currentState = Event.STARTEVENT;
+	
+			boolean endFound = false;
+	
+			while (!endFound) {
+				double randVal = r.nextDouble();
+				double probSum = 0.0;
+				List<Event<?>> currentContext = context.getLast(trieOrder);
+				for (Event<?> symbol : trie.getKnownSymbols()) {
+					probSum += getProbability(currentContext, symbol);
+					if (probSum >= randVal) {
+						endFound = (symbol == Event.ENDEVENT);
+						if (!(symbol == Event.STARTEVENT || symbol == Event.ENDEVENT)) {
+							// only add the symbol the sequence if it is not START
+							// or END
+							context.add(symbol);
+							currentState = symbol;
+							sequence.add(currentState);
+						}
+						break;
 					}
-					break;
 				}
 			}
@@ -164,5 +169,9 @@
 	 */
 	public String getTrieDotRepresentation() {
-		return trie.getDotRepresentation();
+		if (trie == null) {
+			return "";
+		} else {
+			return trie.getDotRepresentation();
+		}
 	}
 
@@ -176,5 +185,9 @@
 	 */
 	public Tree<TrieVertex, Edge> getTrieGraph() {
-		return trie.getGraph();
+		if (trie == null) {
+			return null;
+		} else {
+			return trie.getGraph();
+		}
 	}
 
@@ -189,5 +202,9 @@
 	@Override
 	public String toString() {
-		return trie.toString();
+		if (trie == null) {
+			return "";
+		} else {
+			return trie.toString();
+		}
 	}
 
@@ -199,5 +216,9 @@
 	@Override
 	public int getNumSymbols() {
-		return trie.getNumSymbols();
+		if (trie == null) {
+			return 0;
+		} else {
+			return trie.getNumSymbols();
+		}
 	}
 
@@ -209,4 +230,7 @@
 	@Override
 	public String[] getSymbolStrings() {
+		if (trie == null) {
+			return new String[0];
+		}
 		String[] stateStrings = new String[getNumSymbols()];
 		int i = 0;
@@ -225,5 +249,9 @@
 	@Override
 	public Collection<? extends Event<?>> getEvents() {
-		return trie.getKnownSymbols();
+		if (trie == null) {
+			return new HashSet<Event<?>>();
+		} else {
+			return trie.getKnownSymbols();
+		}
 	}
 
@@ -334,5 +362,9 @@
 	@Override
 	public int getNumFOMStates() {
-		return trie.getNumLeafAncestors();
+		if (trie == null) {
+			return 0;
+		} else {
+			return trie.getNumLeafAncestors();
+		}
 	}
 
@@ -344,5 +376,9 @@
 	@Override
 	public int getNumTransitions() {
-		return trie.getNumLeafs();
+		if (trie == null) {
+			return 0;
+		} else {
+			return trie.getNumLeafs();
+		}
 	}
 }
