agit icon indicating copy to clipboard operation
agit copied to clipboard

Agit crashes when sdcard unavailable (e.g. mounted as storage)

Open rtyley opened this issue 13 years ago • 3 comments

Reported by estliberitas on the Android Market:

I recently installed yr app, and it crashes each time I try to start it. :) Update: it crashes when device is connected to PC as SD card.

This is because Agit expects to find all repos at [sdcard]/git-repos - if the sdcard isn't available, we should show the user a friendly warning instead of crashing,

rtyley avatar Sep 21 '11 11:09 rtyley

So, waiting 4 update in market! :)

estliberitas avatar Oct 02 '11 08:10 estliberitas

Thanks for the poke :-) I'm in the middle of a difficult refactoring at the moment but yeah, I'll try to get a fix for this issue out with the next release.

rtyley avatar Oct 02 '11 18:10 rtyley

Wow, the commit mentioning is pretty nice. This isn't done yet, and I haven't been able to test it, but the functionality should be there to check for the external state, all that needs happen now is to fail gracefully where noted.

The following link is where I stole from wholesale. Might be worthwhile to set up a similar check on startup and set a flag for whether or not the media is mounted, then check that flag whenever you need to get at the SD card. I noticed quite a few file reads. http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29

calebhearth avatar Oct 15 '11 01:10 calebhearth