Skip to content

Commit

Permalink
Small fixes to check for null.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Sep 29, 2022
1 parent 2a6076f commit 90c5b69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/SceneManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,14 @@ export class SceneManager {
const sky = sceneInfo['sky'];

// Check to see if a cubemap has been specified in the header.
if (sky['header'] !== undefined &&
sky['header']['data'] !== undefined) {
if ('header' in sky && sky['header'] !== null && sky['header'] !== undefined &&
'data' in sky['header'] && sky['header']['data'] !== null && sky['header']['data'] !== undefined) {
const data = sky['header']['data'];
for (let i = 0; i < data.length; ++i) {
if (data[i]['key'] === 'cubemap_uri' &&
data[i]['value'] !== undefined) {
data[i]['value'] !== null && data[i]['value'] !== undefined) {
this.scene.addSky(data[i]['value'][0]);
break;
}
}
} else {
Expand Down

0 comments on commit 90c5b69

Please sign in to comment.