monitor:  Allow missing presence property on start

During the initial boot where the fans aren't in inventory yet, if fan
monitor starts before fan presence then the Present property would not
be able to be read.  Catch that exception and let the code continue on
instead of crashing.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ief7527cfb3b2a921318d3775d3912a41b15444b1
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index abc9743..9fe63c1 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -108,8 +108,19 @@
 #endif
 
     // Get the initial presence state
-    _present = util::SDBusPlus::getProperty<bool>(
-        util::INVENTORY_PATH + _name, util::INV_ITEM_IFACE, "Present");
+    bool available = true;
+
+    try
+    {
+        _present = util::SDBusPlus::getProperty<bool>(
+            util::INVENTORY_PATH + _name, util::INV_ITEM_IFACE, "Present");
+    }
+    catch (const util::DBusServiceError& e)
+    {
+        // This could be the initial boot and phosphor-fan-presence hasn't
+        // written to the inventory yet.
+        available = false;
+    }
 
     if (_fanMissingErrorDelay)
     {
@@ -118,7 +129,7 @@
             event, std::bind(&System::fanMissingErrorTimerExpired, &system,
                              std::ref(*this)));
 
-        if (!_present)
+        if (!_present && available)
         {
             // The fan presence application handles the journal for missing
             // fans, so only internally log missing fan info here.