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

Block.setstyle throws an error when block has no style name #3343

Closed
alschmiedt opened this issue Oct 25, 2019 · 2 comments
Closed

Block.setstyle throws an error when block has no style name #3343

alschmiedt opened this issue Oct 25, 2019 · 2 comments
Labels
component: themes issue: bug Describes why the code or behaviour is wrong

Comments

@alschmiedt
Copy link
Contributor

Describe the bug
block.setStyle throws an error when there is a block with no style name and the theme is changed.

To Reproduce

  1. Go to the playground
  2. Go to test blocks and drag out the top block
  3. Try changing the theme
    Observe: ALL THE ERRORS

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Stack Traces

Uncaught Error: Invalid style name: null
    at Blockly.BlockSvg.Blockly.Block.setStyle (block.js:1013)
    at Blockly.WorkspaceSvg.Blockly.Workspace.updateBlockStyles_ (workspace.js:255)
    at Blockly.WorkspaceSvg.Blockly.Workspace.refreshTheme (workspace.js:235)
    at Blockly.WorkspaceSvg.refreshTheme (workspace_svg.js:2567)
    at Blockly.ThemeManager.setTheme (theme_manager.js:94)
    at Blockly.WorkspaceSvg.Blockly.Workspace.setTheme (workspace.js:226)
    at changeTheme (playground.html?dir=ltr&toolbox=test-blocks&side=start&renderer=geras:334)
    at HTMLSelectElement.onchange (playground.html?dir=ltr&toolbox=test-blocks&side=start&renderer=geras:591)
Blockly.Block.setStyle @ block.js:1013
Blockly.Workspace.updateBlockStyles_ @ workspace.js:255
Blockly.Workspace.refreshTheme @ workspace.js:235
Blockly.WorkspaceSvg.refreshTheme @ workspace_svg.js:2567
Blockly.ThemeManager.setTheme @ theme_manager.js:94
Blockly.Workspace.setTheme @ workspace.js:226
changeTheme @ playground.html?dir=ltr&toolbox=test-blocks&side=start&renderer=geras:334
onchange @ playground.html?dir=ltr&toolbox=test-blocks&side=start&renderer=geras:591```

**Additional context**

<!-- Add any other context about the problem here. -->
@alschmiedt alschmiedt added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member component: themes and removed issue: triage Issues awaiting triage by a Blockly team member labels Oct 25, 2019
@alschmiedt alschmiedt added this to the Bug Bash Backlog milestone Oct 25, 2019
@samelhusseini
Copy link
Contributor

@alschmiedt
Copy link
Contributor Author

Fixed in #3334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: themes issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

No branches or pull requests

2 participants