File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,8 @@ export class Csv extends Exporter {
245245 if ( ! cache . user || cache . user . _id . toString ( ) !== location . userId . toString ( ) ) {
246246 cache . user = await User . getUserById ( location . userId )
247247 }
248- if ( ! cache . device || cache . device . _id . toString ( ) !== flat . deviceId . toString ( ) ) {
249- cache . device = await Device . getDeviceById ( flat . deviceId )
248+ if ( ! cache . device || cache . device . _id . toString ( ) !== flat . deviceId ? .toString ( ) ) {
249+ cache . device = flat . deviceId ? await Device . getDeviceById ( flat . deviceId ) : undefined
250250 }
251251 if ( cache . user ) {
252252 flat . user = cache . user . username
Original file line number Diff line number Diff line change @@ -232,14 +232,15 @@ export class GeoPackage extends Exporter {
232232 zoomToEnvelope = calculateBounds ( location . geometry , zoomToEnvelope ) ;
233233 userLastLocation = location ;
234234
235+ const properties = location . properties || { }
235236 const feature : geojson . Feature < geojson . Point , any > = {
236237 type : 'Feature' ,
237238 geometry : location . geometry ,
238- properties : location . properties
239+ properties
239240 } ;
240- feature . properties . mageId = location . _id . toString ( ) ;
241- feature . properties . userId = location . userId . toString ( ) ;
242- feature . properties . deviceId = location . properties . deviceId . toString ( ) ;
241+ feature . properties . mageId = location . _id . toString ( )
242+ feature . properties . userId = location . userId ? .toString ( )
243+ feature . properties . deviceId = properties . deviceId ? properties . deviceId . toString ( ) : undefined
243244
244245 if ( feature . properties . id ) {
245246 delete feature . properties . id ;
You can’t perform that action at this time.
0 commit comments