abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
494 stars 117 forks source link

Exception reading rawTrack #671

Closed devemux86 closed 7 months ago

devemux86 commented 7 months ago

This can often happen when we do a lot of route testing and a termination of BRouter.

There is a *_rawtrack.dat file in /brouter/modes/ folder but with 0 size!

Then BRouter hangs as it can't read the rawtrack file, it keeps throwing an exception and user must delete the file manually (not possible in new Android and data folder) or re-download any route segment.

As OsmTrack.readBinary already returns a null result, we should not also throw a RunTimeException here?

https://github.com/abrensch/brouter/blob/master/brouter-core/src/main/java/btools/router/OsmTrack.java#L288

I can provide a pull request if you agree.

devemux86 commented 7 months ago

Another similar user case was reported here: