Don't save empty objects

Handle an exceptional case where the notify method is called without
any interfaces.

Change-Id: I27424db41e95590968eba7849b424188a0eb743c
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/manager.cpp b/manager.cpp
index a05d2bc..4f56e7a 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -160,11 +160,14 @@
                         (maker->second)(_bus, path.str.c_str()));
         }
 
-        // Hang on to a reference to the object (interfaces)
-        // so it stays on the bus, and so we can make calls
-        // to it if needed.
-        _refs.emplace(
-            path, std::move(ref));
+        if (!ref.empty())
+        {
+            // Hang on to a reference to the object (interfaces)
+            // so it stays on the bus, and so we can make calls
+            // to it if needed.
+            _refs.emplace(
+                path, std::move(ref));
+        }
     }
     catch (const std::exception& e)
     {