if (typeof hub === 'undefined')

{ line of defence