On 12/2/19 10:03 AM, Daniel P. Berrangé wrote:
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;
+ }
I would expect to see a newline here
return virObjectRef(virAccessManagerDefault);
}
Reviewed-by: Cole Robinson <crobinso(a)redhat.com>
- Cole