import { Meteor } from 'meteor/meteor';

const maybeGetUser = (userOrId) => {
  if (!userOrId)
    return null;
  if (userOrId._id)
    return userOrId;
  else
    return Meteor.users.findOne(userOrId);
};

export const getFirstInitial = (user) => {
  user = maybeGetUser(user);
  const firstName = user.profile.name.first;

  return firstName ? firstName.charAt(0) : null;
}

import { Meteor } from 'meteor/meteor';
import * as Helper from './helper';

const maybeGetUser = (userOrId) => {
  if (!userOrId)
    return null;
  if (userOrId._id)
    return userOrId;
  else
    return Meteor.users.findOne(userOrId);
};

export const getFirstInitial = (user) => {
  user = maybeGetUser(user);
  return propExistsDeep(user, ['profile', 'name', 'first']) ? user.profile.name.first.charAt(0) : null;
}

Fix thrown error if no firstName
Bugfix: Fix thrown error if no firstName
