8000 Merge pull request #4012 from NativeScript/tachev/fix-nre · NativeScript/nativescript-cli@c47a5df · GitHub
[go: up one dir, main page]

Skip to content

Commit c47a5df

Browse files
Merge pull request #4012 from NativeScript/tachev/fix-nre
fix: avoid nre when the device log is reported before the device itself during preview
2 parents 33fdfe2 + fe53f04 commit c47a5df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/services/livesync/playground/preview-sdk-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class PreviewSdkService extends EventEmitter implements IPreviewSdkServic
6363
onConnectedDevicesChange: (connectedDevices: ConnectedDevices) => ({ }),
6464
onLogMessage: (log: string, deviceName: string, deviceId: string) => {
6565
const device = _.find(this.connectedDevices, { id: deviceId});
66-
this.emit(DEVICE_LOG_EVENT_NAME, log, deviceId, device.platform);
66+
this.emit(DEVICE_LOG_EVENT_NAME, log, deviceId, device ? device.platform : "");
6767
this.$logger.info(`LOG from device ${deviceName}: ${log}`);
6868
},
6969
onRestartMessage: () => {

0 commit comments

Comments
 (0)
0