The code calling this method expects it to have reported an error on
failure.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/access/viraccessmanager.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c
index 31e1787919..f4120c6139 100644
--- a/src/access/viraccessmanager.c
+++ b/src/access/viraccessmanager.c
@@ -65,6 +65,11 @@ VIR_ONCE_GLOBAL_INIT(virAccessManager);
virAccessManagerPtr virAccessManagerGetDefault(void)
{
+ if (virAccessManagerDefault == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No access manager registered"));
+ return NULL;
+ }
return virObjectRef(virAccessManagerDefault);
}
--
2.23.0