Index: /trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java
===================================================================
--- /trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java	(revision 8779)
+++ /trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java	(revision 8780)
@@ -75,19 +75,34 @@
         Set result = new TreeSet();
         // TODO rework algo for getting partially matched subs
-        result.addAll(PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type")).getSubscriptionIDs());
+        IdEqualsPredicate predicate;
+        predicate = PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type"));
+        if (predicate != null)
+            result.addAll(predicate.getSubscriptionIDs());
         
         Set docIDSubs = new TreeSet();
-        docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID")).getSubscriptionIDs());
-        docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID"));
+        if (predicate != null)
+            docIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("documentID", null);
+        if (predicate != null)
+            docIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(docIDSubs);
         
         Set collIDSubs = new TreeSet();
-        collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID")).getSubscriptionIDs());
-        collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID"));
+        if (predicate != null)
+            collIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", null);
+        if (predicate != null)
+            collIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(collIDSubs);
         
         Set hostIDSubs = new TreeSet();
-        hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host")).getSubscriptionIDs());
-        hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host"));
+        if (predicate != null)
+            hostIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("host", null);
+        if (predicate != null)
+            hostIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(hostIDSubs);
         
Index: /trunk/gsdl3/extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java
===================================================================
--- /trunk/gsdl3/extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java	(revision 8779)
+++ /trunk/gsdl3/extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java	(revision 8780)
@@ -75,19 +75,34 @@
         Set result = new TreeSet();
         // TODO rework algo for getting partially matched subs
-        result.addAll(PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type")).getSubscriptionIDs());
+        IdEqualsPredicate predicate;
+        predicate = PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type"));
+        if (predicate != null)
+            result.addAll(predicate.getSubscriptionIDs());
         
         Set docIDSubs = new TreeSet();
-        docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID")).getSubscriptionIDs());
-        docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID"));
+        if (predicate != null)
+            docIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("documentID", null);
+        if (predicate != null)
+            docIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(docIDSubs);
         
         Set collIDSubs = new TreeSet();
-        collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID")).getSubscriptionIDs());
-        collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID"));
+        if (predicate != null)
+            collIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", null);
+        if (predicate != null)
+            collIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(collIDSubs);
         
         Set hostIDSubs = new TreeSet();
-        hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host")).getSubscriptionIDs());
-        hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host"));
+        if (predicate != null)
+            hostIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("host", null);
+        if (predicate != null)
+            hostIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(hostIDSubs);
         
Index: /trunk/gsdl3/packages/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java
===================================================================
--- /trunk/gsdl3/packages/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java	(revision 8779)
+++ /trunk/gsdl3/packages/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java	(revision 8780)
@@ -75,19 +75,34 @@
         Set result = new TreeSet();
         // TODO rework algo for getting partially matched subs
-        result.addAll(PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type")).getSubscriptionIDs());
+        IdEqualsPredicate predicate;
+        predicate = PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type"));
+        if (predicate != null)
+            result.addAll(predicate.getSubscriptionIDs());
         
         Set docIDSubs = new TreeSet();
-        docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID")).getSubscriptionIDs());
-        docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID"));
+        if (predicate != null)
+            docIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("documentID", null);
+        if (predicate != null)
+            docIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(docIDSubs);
         
         Set collIDSubs = new TreeSet();
-        collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID")).getSubscriptionIDs());
-        collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID"));
+        if (predicate != null)
+            collIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", null);
+        if (predicate != null)
+            collIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(collIDSubs);
         
         Set hostIDSubs = new TreeSet();
-        hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host")).getSubscriptionIDs());
-        hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", null).getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host"));
+        if (predicate != null)
+            hostIDSubs.addAll(predicate.getSubscriptionIDs());
+        predicate = PredicateFactory.getIdEqualsPredicate("host", null);
+        if (predicate != null)
+            hostIDSubs.addAll(predicate.getSubscriptionIDs());
         result.retainAll(hostIDSubs);
         
