state default emulator check
@@ -138,6 +138,10 @@ func (p *State) Config() *config.Config {
// EmulatorServiceAccount returns the service account for the default emulator profile.
func (p *State) EmulatorServiceAccount() (*Account, error) {
emulator := p.conf.Emulators.Default()
+ if emulator == nil {
+ return nil, fmt.Errorf("no default emulator account")
+ }
+
acc := p.conf.Accounts.ByName(emulator.ServiceAccount)
return fromConfig(*acc)
}
