Fixing errors when arrows touched and no cam

This commit is contained in:
David Négrier 2020-06-25 10:43:42 +02:00
parent c322de4412
commit e3e7b92c6a
1 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ export class EnableCameraScene extends Phaser.Scene {
} }
private previousCam(): void { private previousCam(): void {
if (this.cameraSelected === 0) { if (this.cameraSelected === 0 || this.camerasList.length === 0) {
return; return;
} }
this.cameraSelected--; this.cameraSelected--;
@ -128,7 +128,7 @@ export class EnableCameraScene extends Phaser.Scene {
} }
private nextCam(): void { private nextCam(): void {
if (this.cameraSelected === this.camerasList.length - 1) { if (this.cameraSelected === this.camerasList.length - 1 || this.camerasList.length === 0) {
return; return;
} }
this.cameraSelected++; this.cameraSelected++;
@ -137,7 +137,7 @@ export class EnableCameraScene extends Phaser.Scene {
} }
private previousMic(): void { private previousMic(): void {
if (this.microphoneSelected === 0) { if (this.microphoneSelected === 0 || this.microphonesList.length === 0) {
return; return;
} }
this.microphoneSelected--; this.microphoneSelected--;
@ -145,7 +145,7 @@ export class EnableCameraScene extends Phaser.Scene {
} }
private nextMic(): void { private nextMic(): void {
if (this.microphoneSelected === this.microphonesList.length - 1) { if (this.microphoneSelected === this.microphonesList.length - 1 || this.microphonesList.length === 0) {
return; return;
} }
this.microphoneSelected++; this.microphoneSelected++;