item_updater: Fix crash on redundantPriority

When the BIOS update is enabled, the activation of the BIOS does not
have redundantPriority.
After BIOS update, the code will have an activation without
redundantPriority.
In such case, the BMC update will fail due to the crash in freeSpace()
that uses the redundantPriority.

Fix it by checking if the redundantPriority is null or not, and skip
the activations that has no redundantPriority.

Tested: Verify the phosphor-image-updater does not crash on the above
        case.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I92ac9e0f9f02067ceefd0011d01464e8bbd743a5
diff --git a/item_updater.cpp b/item_updater.cpp
index ac95219..204bbf8 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -704,7 +704,8 @@
             // for sorting purposes.
             auto priority = 999;
             if (iter.second.get()->activation() ==
-                server::Activation::Activations::Active)
+                    server::Activation::Activations::Active &&
+                iter.second->redundancyPriority)
             {
                 priority = iter.second->redundancyPriority.get()->priority();
             }