@@ -216,16 +216,12 @@ extend(Raven.prototype, {
216
216
}
217
217
218
218
var domainContext = ( domain . active && domain . active . sentryContext ) || { } ;
219
- kwargs . user = extend ( { } , this . _globalContext . user , domainContext . user , kwargs . user ) ;
220
- kwargs . tags = extend ( { } , this . _globalContext . tags , domainContext . tags , kwargs . tags ) ;
221
- kwargs . extra = extend (
222
- { } ,
223
- this . _globalContext . extra ,
224
- domainContext . extra ,
225
- kwargs . extra
226
- ) ;
219
+ var globalContext = this . _globalContext || { } ;
220
+ kwargs . user = extend ( { } , globalContext . user , domainContext . user , kwargs . user ) ;
221
+ kwargs . tags = extend ( { } , globalContext . tags , domainContext . tags , kwargs . tags ) ;
222
+ kwargs . extra = extend ( { } , globalContext . extra , domainContext . extra , kwargs . extra ) ;
227
223
kwargs . breadcrumbs = {
228
- values : domainContext . breadcrumbs || this . _globalContext . breadcrumbs || [ ]
224
+ values : domainContext . breadcrumbs || globalContext . breadcrumbs || [ ]
229
225
} ;
230
226
231
227
/*
@@ -237,13 +233,13 @@ extend(Raven.prototype, {
237
233
parseUser returns a partial kwargs object with a `request` property and possibly a `user` property
238
234
*/
239
235
kwargs . request = this . _createRequestObject (
240
- this . _globalContext . request ,
236
+ globalContext . request ,
241
237
domainContext . request ,
242
238
kwargs . request
243
239
) ;
244
240
if ( Object . keys ( kwargs . request ) . length === 0 ) {
245
241
var req = this . _createRequestObject (
246
- this . _globalContext . req ,
242
+ globalContext . req ,
247
243
domainContext . req ,
248
244
kwargs . req
249
245
) ;
@@ -265,7 +261,7 @@ extend(Raven.prototype, {
265
261
kwargs . logger = kwargs . logger || this . loggerName ;
266
262
kwargs . event_id = eventId ;
267
263
kwargs . timestamp = new Date ( ) . toISOString ( ) . split ( '.' ) [ 0 ] ;
268
- kwargs . project = this . dsn . project_id ;
264
+ kwargs . project = this . dsn && this . dsn . project_id ;
269
265
kwargs . platform = 'node' ;
270
266
kwargs . release = this . release ;
271
267
0 commit comments