An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added more null checking to getDeviceName in ConnectModal

jdpigeon 288f486e c55de6d2

+10 -2
+10 -2
app/components/CollectComponent/ConnectModal.js
··· 45 45 handleSearch: () => void; 46 46 handleStartTutorial: () => void; 47 47 48 - static getDeviceName(device: any) { 49 - return isNil(device.name) ? device.id : device.name; 48 + static getDeviceName(device: any): string { 49 + if (!isNil(device)) { 50 + if (Object.prototype.hasOwnProperty.call(device, 'name')) { 51 + return device.name; 52 + } 53 + if (Object.prototype.hasOwnProperty.call(device, 'name')) { 54 + return device.id; 55 + } 56 + } 57 + return ''; 50 58 } 51 59 52 60 constructor(props: Props) {