Skip to content

Commit 2e5f77b

Browse files
committed
Fix pointer def check needed when no user provided for trusted auth
1 parent 3df3892 commit 2e5f77b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cmd/modern/root/config/delete-context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (c *DeleteContext) run() {
6464

6565
if c.cascade {
6666
config.DeleteEndpoint(context.Endpoint)
67-
if *context.ContextDetails.User != "" {
67+
if context.ContextDetails.User != nil && *context.ContextDetails.User != "" {
6868
config.DeleteUser(*context.ContextDetails.User)
6969
}
7070
}

cmd/modern/root/uninstall.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package root
55

66
import (
77
"fmt"
8-
"path/filepath"
98
"strings"
109

1110
"github.com/microsoft/go-sqlcmd/internal/cmdparser"
@@ -158,7 +157,7 @@ func (c *Uninstall) userDatabaseSafetyCheck(controller *container.Controller, id
158157
output.FatalfWithHints([]string{
159158
fmt.Sprintf(
160159
"If the database is mounted, run `sqlcmd query \"use master; DROP DATABASE [%s]\"`",
161-
strings.TrimSuffix(filepath.Base(databaseFile), ".mdf")),
160+
"<database_name>"),
162161
"Pass in the flag --force to override this safety check for user (non-system) databases"},
163162
"Unable to continue, a user (non-system) database (%s) is present", databaseFile)
164163
}

0 commit comments

Comments
 (0)