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

NPE in track context's Point appearance menu #19993

Closed
sonora opened this issue Jun 2, 2024 · 11 comments
Closed

NPE in track context's Point appearance menu #19993

sonora opened this issue Jun 2, 2024 · 11 comments

Comments

@sonora
Copy link
Member

sonora commented Jun 2, 2024

Displayed as 'Track' a GPX file which has no <trk> or <trkpt>, just several <wpt>, each tagged with one of two different <type> tags.

On the map, tap any of its waypoint icons, tap "Open track", then on the track context menu tap the 'Point' button, then "3-dots>Change default appearance'. This produces this NPE
exception.log.txt.

@sonora
Copy link
Member Author

sonora commented Jun 2, 2024

Possibly related to the issue described in #19971 (comment): We may fail to properly identify wpts' pointsGroups here, and hence also do not assign the right icon color.

@yuriiurshuliak
Copy link

yuriiurshuliak commented Jun 25, 2024

I was unable to reproduce this issue. I attempted to reproduce it by selecting a track containing only <wpt> tags, then tapped the waypoint icon on the map and tried to changing default appearance. No problems related to NPE occurred.

Here's the track I used: Algeria.zip

The problem might be specific to the track used. Please upload it here so we can investigate further.

@sonora
Copy link
Member Author

sonora commented Jun 25, 2024

Perhaps because your track only contains one points_group.

EDIT: But perhaps the issue has another cause, here is a rather short file which produces the NPE crash for me: npe-test.gpx.txt

@yuriiurshuliak
Copy link

Unfortunately, attempting to access the specified track results in an error on my end.

@sonora
Copy link
Member Author

sonora commented Jun 26, 2024

Once downloaded, you probably forgot to rename it back removing the .txt extension in the end. Github does not allow sharing files here ending in .gpx, hence the little trick... 😉

@yuriiurshuliak
Copy link

No, I have already renamed the track in Total Commander and removed the .txt extension. Please let me know if it opens correctly for you.

@sonora
Copy link
Member Author

sonora commented Jun 27, 2024

My apologies, you are right - I must have fatfingered the file.

I have updated the post above with a very short npe-test.gpx file, which produces the crash for me... can you reproduce?

@yuriiurshuliak
Copy link

It's quite strange, but this file still won't open and displays an error. I tried importing it using two methods. It seems the file might be corrupted.

OsmAnd~ 4.8.0#2610m, released: 2024-06-28

video_2024-06-28_16-48-44.mp4

@sonora
Copy link
Member Author

sonora commented Jun 28, 2024

Interesting... yes, good finding. I can confirm that error when using one of OsmAnd's "import" mechanisms for file npe-test.gpx.

It is the same root cause I am reporting here, and you have it explicitly on your recording: There is some 'null' interpretation of this line <{null}osmand:points_groups .

  • When you try to import the track, our import code notices the issue immediately.
  • When instead you just place the track manually in OsmAnd's "tracks" folder tree, you can display the file ok. The NPE then only occurs when you try to change the Waypoint appearance using the steps I have outlined in post 1.

I see no reason why OsmAnd creates an NPE for this file at all, so I believe this needs fixing...

There is also a cross connect here to issue #19892. The 2 issues are in the same code, and should likely be fixed together.

@DmitryAlexei
Copy link
Contributor

Sonora, so this issue can be closed as duplicate of #19892 ?

@sonora
Copy link
Member Author

sonora commented Jul 10, 2024

#19892 is not exactly a duplicate, because it deals with a functionality bug, while this here is about an occurring NPE. But yes, both issues should be fixed together, and hence be known to whoever tackles this.

@vshcherb vshcherb closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
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

No branches or pull requests

4 participants