Skip to content

Commit

Permalink
add guards to bcf set viewpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtil committed Oct 10, 2023
1 parent 22783a5 commit 799676a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ class BCFViewpointsPlugin extends Plugin {

scene.clearSectionPlanes();

if (bcfViewpoint.clipping_planes) {
if (bcfViewpoint.clipping_planes && bcfViewpoint.clipping_planes.length > 0) {
bcfViewpoint.clipping_planes.forEach(function (e) {
let pos = xyzObjectToArray(e.location, tempVec3);
let dir = xyzObjectToArray(e.direction, tempVec3);
Expand All @@ -653,7 +653,7 @@ class BCFViewpointsPlugin extends Plugin {

scene.clearLines();

if (bcfViewpoint.lines) {
if (bcfViewpoint.lines && bcfViewpoint.lines.length > 0) {
const positions = [];
const indices = [];
let i = 0;
Expand Down Expand Up @@ -683,7 +683,7 @@ class BCFViewpointsPlugin extends Plugin {

scene.clearBitmaps();

if (bcfViewpoint.bitmaps) {
if (bcfViewpoint.bitmaps && bcfViewpoint.bitmaps.length > 0) {
bcfViewpoint.bitmaps.forEach(function (e) {
const bitmap_type = e.bitmap_type || "jpg"; // "jpg" | "png"
const bitmap_data = e.bitmap_data; // base64
Expand Down

0 comments on commit 799676a

Please sign in to comment.