Skip to content
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

Fix some bad assumptions in playlab blocks #13369

Merged
merged 2 commits into from Feb 23, 2017
Merged

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Feb 22, 2017

Namely, the assumption that our definition of skin will always be
fully-formed, with all the fields of all the types that we expect. This
assumption is valid in all of our Code Studio environments, but fails in
levelbuilder, where we initialize simple readonly blockspaces to display
block previews.

This assumption has been failing for a while, but for most of that time
this code was being loaded async, so when it broke it didn't break any
of the other javascript on the page. A recent change altered that,
revealing this problem.

Namely, the assumption that our definition of skin will always be
fully-formed, with all the fields of all the types that we expect. This
assumption is valid in all of our Code Studio environments, but fails in
levelbuilder, where we initialize simple readonly blockspaces to display
block previews.

This assumption has been failing for a while, but for most of that time
this code was being loaded async, so when it broke it didn't break any
of the other javascript on the page. A recent change altered that,
revealing this problem.

if (level && level.paramRestrictions) {
var restrictions = level.paramRestrictions && level.paramRestrictions.playSound;
if (restrictions) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these two if statements can be combined into one triple null check.

@Hamms Hamms merged commit b46549b into staging Feb 23, 2017
@Hamms Hamms deleted the fix-levelbuilder-playlab-js branch February 23, 2017 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants