Remove two harmless exceptions at startup time

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@809484 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/gshell/gshell-admin/src/main/java/org/apache/felix/karaf/gshell/admin/internal/AdminServiceImpl.java b/karaf/gshell/gshell-admin/src/main/java/org/apache/felix/karaf/gshell/admin/internal/AdminServiceImpl.java
index 2e7ec98..5f7ea9f 100644
--- a/karaf/gshell/gshell-admin/src/main/java/org/apache/felix/karaf/gshell/admin/internal/AdminServiceImpl.java
+++ b/karaf/gshell/gshell-admin/src/main/java/org/apache/felix/karaf/gshell/admin/internal/AdminServiceImpl.java
@@ -81,6 +81,12 @@
 
     public synchronized void init() throws Exception {
         try {
+            if (!storageLocation.isFile()) {
+                if (storageLocation.exists()) {
+                    LOGGER.error("Instances storage location should be a file: " + storageLocation);
+                }
+                return;
+            }
             Properties storage = loadStorage(storageLocation);
             int count = Integer.parseInt(storage.getProperty("count", "0"));
             defaultPortStart = Integer.parseInt(storage.getProperty("port", Integer.toString(defaultPortStart)));
diff --git a/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/completer/CommandsCompleter.java b/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/completer/CommandsCompleter.java
index 3030236..48143fe 100644
--- a/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/completer/CommandsCompleter.java
+++ b/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/completer/CommandsCompleter.java
@@ -52,7 +52,9 @@
     }
 
     public void unregister(ServiceReference reference) {
-        completers.remove(reference);
+        if (reference != null) {
+            completers.remove(reference);
+        }
     }
 
     private Set<String> getNames(ServiceReference reference) {