File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 314314
315315 function register ( config ) {
316316 if ( ! config ) {
317- window . console . log ( 'You must pass a config object to register the kit ' + name ) ;
317+ console . log ( 'You must pass a config object to register the kit ' + name ) ;
318318 return ;
319319 }
320320
321321 if ( ! isobject ( config ) ) {
322- window . console . log ( '\'config\' must be an object. You passed in a ' + typeof config ) ;
322+ console . log ( '\'config\' must be an object. You passed in a ' + typeof config ) ;
323323 return ;
324324 }
325325
333333 constructor : constructor
334334 } ;
335335 }
336- window . console . log ( 'Successfully registered ' + name + ' to your mParticle configuration' ) ;
336+ console . log ( 'Successfully registered ' + name + ' to your mParticle configuration' ) ;
337337 }
338338
339- if ( window && window . mParticle && window . mParticle . addForwarder ) {
340- window . mParticle . addForwarder ( {
341- name : name ,
342- constructor : constructor ,
343- getId : getId
344- } ) ;
339+ if ( typeof window !== 'undefined' ) {
340+ if ( window && window . mParticle && window . mParticle . addForwarder ) {
341+ window . mParticle . addForwarder ( {
342+ name : name ,
343+ constructor : constructor ,
344+ getId : getId
345+ } ) ;
346+ }
345347 }
346348
347349 module . exports = {
You can’t perform that action at this time.
0 commit comments