@@ -84,7 +84,7 @@ func NewApp(config config.Config, migrateFlag bool) (app *App, err error) {
8484
8585 log .Print ("Initializing Authorizing account" )
8686
87- if config .Accounts . AuthorizingSeed == nil {
87+ if ! ( config .Accounts != nil && config . Accounts . AuthorizingSeed != nil ) {
8888 log .Warning ("No accounts.authorizing_seed param. Skipping..." )
8989 } else {
9090 err = ts .InitAccount (* config .Accounts .AuthorizingSeed )
@@ -93,7 +93,7 @@ func NewApp(config config.Config, migrateFlag bool) (app *App, err error) {
9393 }
9494 }
9595
96- if config .Accounts . IssuingSeed == nil {
96+ if ! ( config .Accounts != nil && config . Accounts . IssuingSeed != nil ) {
9797 log .Warning ("No accounts.issuing_seed param. Skipping..." )
9898 } else {
9999 log .Print ("Initializing Issuing account" )
@@ -107,7 +107,7 @@ func NewApp(config config.Config, migrateFlag bool) (app *App, err error) {
107107
108108 log .Print ("Creating and starting PaymentListener" )
109109
110- if config .Accounts . ReceivingAccountId == nil {
110+ if ! ( config .Accounts != nil && config . Accounts . ReceivingAccountId != nil ) {
111111 log .Warning ("No accounts.receiving_account_id param. Skipping..." )
112112 } else if config .Hooks .Receive == nil {
113113 log .Warning ("No hooks.receive param. Skipping..." )
@@ -158,13 +158,13 @@ func (a *App) Serve() {
158158 goji .Use (handlers .ApiKeyMiddleware (a .config .ApiKey ))
159159 }
160160
161- if a .config .Accounts .AuthorizingSeed != nil {
161+ if a .config .Accounts != nil && a . config . Accounts .AuthorizingSeed != nil {
162162 goji .Post ("/authorize" , requestHandlers .Authorize )
163163 } else {
164164 log .Warning ("accounts.authorizing_seed not provided. /authorize endpoint will not be available." )
165165 }
166166
167- if a .config .Accounts .IssuingSeed != nil {
167+ if a .config .Accounts != nil && a . config . Accounts .IssuingSeed != nil {
168168 goji .Post ("/send" , requestHandlers .Send )
169169 } else {
170170 log .Warning ("accounts.issuing_seed not provided. /send endpoint will not be available." )
0 commit comments