diff --git a/lnd.go b/lnd.go
index <HASH>..<HASH> 100644
--- a/lnd.go
+++ b/lnd.go
@@ -93,7 +93,11 @@ var (
 // defers created in the top-level scope of a main method aren't executed if
 // os.Exit() is called.
 func lndMain() error {
-	defer ltndLog.Info("Shutdown complete")
+	defer func() {
+		if logRotatorPipe != nil {
+			ltndLog.Info("Shutdown complete")
+		}
+	}()
 
 	// Load the configuration, and parse any command line options. This
 	// function will also set up logging properly.
lnd: only print shutdown message if logs are initialized

In this commit, we fix a slight bug recently introduced by the addition
of the new signal package. As we now use a regular defer for many
actions, it may be possible that the logs aren't yet initialized (for
example, lnd -h), which can cause a panic if the shutdown procedure goes
to log before the logs have been initialized.