fix a couple things in create project from db dialog (#14511)

This commit is contained in:
Kim Santiago
2021-03-03 10:33:52 -08:00
committed by GitHub
parent 625c4520da
commit cea55560e8
3 changed files with 20 additions and 8 deletions

View File

@@ -32,7 +32,11 @@ export function defaultProjectNameNewProj(): string {
*
* @param dbName the database name to base the default project name off of
*/
export function defaultProjectNameFromDb(dbName: string): string {
export function defaultProjectNameFromDb(dbName: string | undefined): string {
if (!dbName) {
return '';
}
const projectNameStarter = constants.defaultProjectNameStarter + dbName;
const defaultLocation = defaultProjectSaveLocation() ?? vscode.Uri.file(os.homedir());
const projectPath: string = path.join(defaultLocation.fsPath, projectNameStarter);