mirror of
https://github.com/unpoller/unpoller.git
synced 2026-10-17 20:03:53 +02:00
fix crash when config not present
This commit is contained in:
@@ -53,7 +53,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
u := &InputUnifi{}
|
||||
u := &InputUnifi{Config: &Config{}}
|
||||
|
||||
poller.NewInput(&poller.InputPlugin{
|
||||
Name: "unifi",
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
// Initialize gets called one time when starting up.
|
||||
// Satisfies poller.Input interface.
|
||||
func (u *InputUnifi) Initialize(l poller.Logger) error {
|
||||
if u.Disable {
|
||||
l.Logf("UniFi input plugin disabled!")
|
||||
if u.Config == nil || u.Disable {
|
||||
l.Logf("UniFi input plugin disabled or missing configuration!")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user