Last Comment Bug 773943 - java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp.getTempDirectory(
: java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp.getTempDirector...
: crash, regression
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: 16 Branch
: ARM Android
-- critical (vote)
: Firefox 17
Assigned To: Arkady Blyakher [:rkd]
: Sebastian Kaspari (:sebastian)
Depends on:
Blocks: 769438 772651
  Show dependency treegraph
Reported: 2012-07-14 04:06 PDT by Scoobidiver (away)
Modified: 2012-07-24 10:31 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix null pointer exception from accessing getExternalFilesDir (4.26 KB, patch)
2012-07-16 13:23 PDT, Arkady Blyakher [:rkd]
snorp: review+
blassey.bugs: feedback+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description User image Scoobidiver (away) 2012-07-14 04:06:14 PDT
There's one crash in 16.0a1/20120712: bp-5350a1f7-14f1-418b-9bdf-7c17c2120713.

	at org.mozilla.gecko.GeckoApp.getTempDirectory(
	at org.mozilla.gecko.GeckoApp.deleteTempFiles(
	at org.mozilla.gecko.GeckoApp.onDestroy(
	at org.mozilla.gecko.BrowserApp.onDestroy(
	at android.os.Handler.dispatchMessage(
	at android.os.Looper.loop(
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
Comment 1 User image Geoff Brown [:gbrown] 2012-07-16 10:35:47 PDT
Looks like this was introduced by bug 769438 and bug 772651:

getExternalFilesDir can return null.
Comment 2 User image Kartikaya Gupta ( 2012-07-16 12:36:34 PDT
Bug 772888 is also related (caused by getExternalFilesDir returning null) but the patch on there won't fix this, I think, because it's a different call.
Comment 3 User image Arkady Blyakher [:rkd] 2012-07-16 13:23:25 PDT
Created attachment 642697 [details] [diff] [review]
fix null pointer exception from accessing getExternalFilesDir

According to the Android ref, getExternalFilesDir returns null if external storage is not currently mounted so it could not ensure the path exists; you will need to call this method again when it is available. This patch checks for nulls and responds appropriately, but it might be better to either retry accessing this directory upon failure (at least once) or to use a different storage directory altogether.
Comment 4 User image Arkady Blyakher [:rkd] 2012-07-17 10:11:23 PDT
Comment on attachment 642697 [details] [diff] [review]
fix null pointer exception from accessing getExternalFilesDir

Bug caused by (feature/regressing bug #): 769438 and 772651
User impact if declined: Fixed a null-pointer exception that can cause a crash for image sharing
Testing completed (on m-c, etc.): m-c (
Risk to taking this patch (and alternatives if risky): Risk is minimal
String or UUID changes made by this patch: None
Comment 5 User image Ryan VanderMeulen [:RyanVM] 2012-07-20 21:04:07 PDT
Comment 6 User image Alex Keybl [:akeybl] 2012-07-23 10:24:31 PDT
Comment on attachment 642697 [details] [diff] [review]
fix null pointer exception from accessing getExternalFilesDir

[Triage Comment]
Minimal risk, fixes a low-volume crash regression in 16, and can be backed out if this causes any worse regressions. Approved for Aurora 16.

Note You need to log in before you can comment on or make changes to this bug.