Skip to content

Commit

Permalink
feat: check geometry file for undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jan 28, 2020
1 parent 6cda7c0 commit b15fbb1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions server/utils/mixerConnections/CasparCGConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class CasparCGConnection {
injectCasparCGSetting() {
const geometryFile = path.join('storage', 'default-casparcg.ccg');

let geometry: ICasparCGMixerGeometryFile | undefined = undefined
let geometry: ICasparCGMixerGeometryFile | undefined
try {
let inputObj = JSON.parse(fs.readFileSync(geometryFile, {
encoding: 'utf-8'
Expand All @@ -73,11 +73,12 @@ export class CasparCGConnection {
// Handling a file should be removed from Constants in the future:
console.log('CasparCG Audio geometry file has not been created')
}

this.mixerProtocol.fromMixer = geometry.fromMixer
this.mixerProtocol.toMixer = geometry.toMixer
this.mixerProtocol.channelLabels = geometry.channelLabels
this.mixerProtocol.sourceOptions = geometry.sourceOptions
if (geometry) {
this.mixerProtocol.fromMixer = geometry.fromMixer || this.mixerProtocol.fromMixer
this.mixerProtocol.toMixer = geometry.toMixer || this.mixerProtocol.toMixer
this.mixerProtocol.channelLabels = geometry.channelLabels || this.mixerProtocol.channelLabels
this.mixerProtocol.sourceOptions = geometry.sourceOptions || this.mixerProtocol.sourceOptions
}
}

setupMixerConnection() {
Expand Down

0 comments on commit b15fbb1

Please sign in to comment.