Skip to content

Exception in the load process of the object structure resolved #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Exception in the load process of the object structure resolved #3

wants to merge 1 commit into from

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