Skip to content

Conversation

SolidusAbi
Copy link

Regular expression test generates a exception because it was looking for a dataSource.source field and there were elements in the array do not contain dataSource field.

@@ -242,7 +242,7 @@ angular.module('atlasDemo').provider('loadingManager', ['mainAppProvider', 'volu

var objStructures = atlasStructure.Structure.filter(item => {
if (Array.isArray(item.sourceSelector)) {
return item.sourceSelector.some(selector => /\.obj$/.test(selector.dataSource.source));
return item.sourceSelector.some(selector => /\.obj$/.test(selector.dataSource));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we want to list structure using ".obj" files so we can load them later using the OBJLoader.
The correction you provide is wrong as dataSource is an object and the regex can not be used on objects.
To account for the presence of the object, the code should be : test(selector.dataSource && selector.dataSource.source)

@stity
Copy link
Owner

stity commented Oct 9, 2017

@SolidusAbi I added a comment to your change.
But just so you know, OABrowser (the new name of the app) is now managed here https://github.com/mhalle/oabrowser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants