loopd: nil-pointer bug when showing subsystems

This commit is contained in:
ziggie 2023-03-24 16:07:16 +01:00 committed by Slyghtning
parent 0fe952a5c7
commit 59d7d08aee
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -180,13 +180,6 @@ func Run(rpcCfg RPCConfig) error {
os.Exit(0)
}
// Special show command to list supported subsystems and exit.
if config.DebugLevel == "show" {
fmt.Printf("Supported subsystems: %v\n",
logWriter.SupportedSubsystems())
os.Exit(0)
}
// Validate our config before we proceed.
if err := Validate(&config); err != nil {
return err
@ -205,6 +198,14 @@ func Run(rpcCfg RPCConfig) error {
logWriter := build.NewRotatingLogWriter()
SetupLoggers(logWriter, shutdownInterceptor)
// Special show command to list supported subsystems and exit.
if config.DebugLevel == "show" {
fmt.Printf("Supported subsystems: %v\n",
logWriter.SupportedSubsystems())
os.Exit(0)
}
err = logWriter.InitLogRotator(
filepath.Join(config.LogDir, defaultLogFilename),
config.MaxLogFileSize, config.MaxLogFiles,