Error with undefined user name in server.js

Added an if === undefined condition to mitigate