change the order for which we check these to avoid a NPE

This commit is contained in:
Cody Lee
2022-12-20 20:09:04 -06:00
parent 08a3c1d66b
commit 3f509198fe
+4 -1
View File
@@ -194,7 +194,10 @@ func (u *DatadogUnifi) Enabled() bool {
if u == nil {
return false
}
if u.Enable == nil || u.Config == nil {
if u.Config == nil {
return false
}
if u.Enable == nil {
return false
}
return *u.Enable