Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Crash switching variables on set statements (NPE) #746

Open
Labels
@plattysoft

Description

I have seen this crash at least 3 times and it is quite replicable, but not 100%

Steps to replicate:

  • Add 2 set {variable} to {value} pieces
  • Swap the variable name of one
  • Swap the variable name of the other

Not sure if there needs to be more than 3 variables, if the other pieces on the workspace are relevant, or if they need to be connected, but each time I've tried to build a relatively complex program involving 3 variables it has crashed at some point.

Something like this is what I was trying to write:

position = 0
increasing = false
if (increasing) {
 position = position +1
 if (position == max) {
 increasing = false
 }
}
else {
 position = position -1
 if (position == min) {
 increasing = true
 }
}

This is the stack trace I am getting:

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.blockly.android.control.WorkspaceStats$VariableInfoImpl.removeField(com.google.blockly.model.FieldVariable)' on a null object reference
at com.google.blockly.android.control.WorkspaceStats1ドル.onValueChanged(WorkspaceStats.java:52)
at com.google.blockly.model.Field1ドル.run(Field.java:240)
at com.google.blockly.model.Block.runAsPossibleEventGroup(Block.java:1318)
at com.google.blockly.model.Field.runAsPossibleEventGroup(Field.java:252)
at com.google.blockly.model.Field.fireValueChanged(Field.java:232)
at com.google.blockly.model.FieldVariable.setVariable(FieldVariable.java:74)
at com.google.blockly.android.ui.fieldview.BasicFieldVariableView.setSelection(BasicFieldVariableView.java:116)
at android.widget.Spinner$DropdownPopup1ドル.onItemClick(Spinner.java:1186)
at android.widget.AdapterView.performItemClick(AdapterView.java:318)
at android.widget.AbsListView.performItemClick(AbsListView.java:1158)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3127)
at android.widget.AbsListView3ドル.run(AbsListView.java:4042)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
01-01 00:37:43.678 3437-3437/com.plattysoft.blocklyrainbowhat I/Process: Sending signal. PID: 3437 SIG: 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /