celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erjanalt...@apache.org
Subject celix git commit: CELIX-404: Fix for crash with inspect command
Date Fri, 24 Feb 2017 22:49:55 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 6785a38c4 -> b6c369907


CELIX-404: Fix for crash with inspect command


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b6c36990
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b6c36990
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b6c36990

Branch: refs/heads/develop
Commit: b6c36990718c8f46e61150aee79fe189a7803731
Parents: 6785a38
Author: Erjan Altena <erjanaltena@gmail.com>
Authored: Fri Feb 24 23:49:15 2017 +0100
Committer: Erjan Altena <erjanaltena@gmail.com>
Committed: Fri Feb 24 23:49:15 2017 +0100

----------------------------------------------------------------------
 framework/private/src/service_registry.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b6c36990/framework/private/src/service_registry.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_registry.c b/framework/private/src/service_registry.c
index 8df355f..d27cc32 100644
--- a/framework/private/src/service_registry.c
+++ b/framework/private/src/service_registry.c
@@ -607,12 +607,14 @@ celix_status_t serviceRegistry_getServicesInUse(service_registry_pt
registry, bu
 
     hash_map_pt refsMap = hashMap_get(registry->serviceReferences, bundle);
 
-    hash_map_iterator_pt iter = hashMapIterator_create(refsMap);
-    while (hashMapIterator_hasNext(iter)) {
-        service_reference_pt ref = hashMapIterator_nextValue(iter);
-        arrayList_add(result, ref);
+    if(refsMap) {
+        hash_map_iterator_pt iter = hashMapIterator_create(refsMap);
+        while (hashMapIterator_hasNext(iter)) {
+            service_reference_pt ref = hashMapIterator_nextValue(iter);
+            arrayList_add(result, ref);
+        }
+        hashMapIterator_destroy(iter);
     }
-    hashMapIterator_destroy(iter);
 
     //UNLOCK
     celixThreadRwlock_unlock(&registry->lock);


Mime
View raw message