mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-05 20:15:58 +00:00
bug 707929 - java.lang.NullPointerException @ ZipFile.getInputStream(ZipFile.java:256) r=mfinke a=java-only
This commit is contained in:
parent
81be12ab70
commit
f4d5eb2e45
@ -236,7 +236,11 @@ public class AboutHomeContent extends ScrollView {
|
||||
return is;
|
||||
File applicationPackage = new File(activity.getApplication().getPackageResourcePath());
|
||||
ZipFile zip = new ZipFile(applicationPackage);
|
||||
if (zip == null)
|
||||
return null;
|
||||
ZipEntry fileEntry = zip.getEntry("recommended-addons.json");
|
||||
if (fileEntry == null)
|
||||
return null;
|
||||
return zip.getInputStream(fileEntry);
|
||||
}
|
||||
|
||||
@ -246,6 +250,8 @@ public class AboutHomeContent extends ScrollView {
|
||||
try {
|
||||
byte[] buf = new byte[32768];
|
||||
InputStream fileStream = getRecommendedAddonsStream(activity);
|
||||
if (fileStream == null)
|
||||
return;
|
||||
StringBuffer jsonString = new StringBuffer();
|
||||
int read = 0;
|
||||
while ((read = fileStream.read(buf, 0, 32768)) != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user