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

NullPointerException on undoing #812

Closed
matkoniecz opened this issue Jan 28, 2018 · 4 comments
Closed

NullPointerException on undoing #812

matkoniecz opened this issue Jan 28, 2018 · 4 comments
Assignees
Labels

Comments

@matkoniecz
Copy link
Member

I am not sure whatever dev version of StreetComplete calls home with crash reports so I post it here.

I can trigger crash by selecting undo.

It seems likely that making SC edit, making edit to the same object using Vespucci editor and later using undo in SC caused this problem to appear.

I kept my SC in the same state - I can provide more debug info if that would be useful.

01-28 17:58:31.988 13919-13919/de.westnordost.streetcomplete.debug E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                     Process: de.westnordost.streetcomplete.debug, PID: 13919
                                                                                     java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Map de.westnordost.osmapi.map.data.Element.getTags()' on a null object reference
                                                                                         at de.westnordost.streetcomplete.MainActivity.confirmUndo(MainActivity.java:316)
                                                                                         at de.westnordost.streetcomplete.MainActivity.onOptionsItemSelected(MainActivity.java:350)
                                                                                         at android.app.Activity.onMenuItemSelected(Activity.java:2963)
                                                                                         at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:368)
                                                                                         at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195)
                                                                                         at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:108)
                                                                                         at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:108)
                                                                                         at android.support.v7.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:65)
                                                                                         at android.support.v7.widget.Toolbar$1.onMenuItemClick(Toolbar.java:202)
                                                                                         at android.support.v7.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:780)
                                                                                         at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:822)
                                                                                         at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:171)
                                                                                         at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:973)
                                                                                         at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:963)
                                                                                         at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:624)
                                                                                         at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:150)
                                                                                         at android.view.View.performClick(View.java:5207)
                                                                                         at android.view.View$PerformClick.run(View.java:21177)
                                                                                         at android.os.Handler.handleCallback(Handler.java:739)
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                         at android.os.Looper.loop(Looper.java:148)
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:5441)
                                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
@matkoniecz
Copy link
Member Author

matkoniecz commented Jan 28, 2018

In case that current state of my SC install is not useful - please, tell me so I can reset it (I plan on using SC and making PR for #750 (comment) )

@matkoniecz
Copy link
Member Author

Crash was triggered on SC trunk, revision 9f25eeb

@matkoniecz
Copy link
Member Author

@westnordost Is current state of app likely to be useful? I am keeping it unused for now, but I prefer to be able to install SC into my phone, so if there is any debug info that would be useful I prefer to provide it now.

@westnordost westnordost self-assigned this Jan 31, 2018
@westnordost
Copy link
Member

To solve this problem for yourself, you can either clear all data for the app of course, or, you click the upload button once. Part of the upload process is to remove any closed quests that are older than yesterday.
The error is caused by a closed quest at the top of the undo queue which does not have an element associated with it anymore. This happens always when the element the quest was trying to modify was deleted in the meantime and thus the quest was closed as conflicting. The bug leads to that in the case as experienced by you, you are unable to undo anything, because it leads to a crash, for one day.

The fix is to not close a conflicting quest, but to delete it, so it is not a candidate for the undo-feature.

westnordost added a commit that referenced this issue Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants