Merge pull request #16823 from Arcanemagus/allow-empty-username

Handle empty username
This commit is contained in:
Max Brunsfeld 2018-02-22 17:21:46 -08:00 committed by GitHub
commit 45247632da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ class AtomApplication extends EventEmitter {
// Public: The entry point into the Atom application.
static open (options) {
if (!options.socketPath) {
const username = process.platform === 'win32' ? process.env.USERNAME : process.env.USER
const {username} = os.userInfo()
// Lowercasing the ATOM_HOME to make sure that we don't get multiple sockets
// on case-insensitive filesystems due to arbitrary case differences in paths.
@ -44,7 +44,7 @@ class AtomApplication extends EventEmitter {
.update('|')
.update(process.arch)
.update('|')
.update(username)
.update(username || '')
.update('|')
.update(atomHomeUnique)