You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
src/arsc_parser: avoid some NULL dereferences (TODO: should these ever happen or are we doing something wrong?)
This commit is contained in:
@@ -81,6 +81,9 @@ public class ArscResourcesParser {
|
|||||||
System.out.println("¯¯ in getResourceId");
|
System.out.println("¯¯ in getResourceId");
|
||||||
ResTableValueEntry res = (ResTableValueEntry)arscFile.getResourceByName(name, typeId);
|
ResTableValueEntry res = (ResTableValueEntry)arscFile.getResourceByName(name, typeId);
|
||||||
|
|
||||||
return res.entryId;
|
if(res != null)
|
||||||
|
return res.entryId;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ public class ResTablePackageChunk {
|
|||||||
System.out.println("¯¯ in ResTablePackageChunk - getResourceByName");
|
System.out.println("¯¯ in ResTablePackageChunk - getResourceByName");
|
||||||
|
|
||||||
List<BaseTypeChunk> typeList = typeInfoIndexer.get(typeId); // The first chunk in typeList should be ResTableTypeSpecChunk
|
List<BaseTypeChunk> typeList = typeInfoIndexer.get(typeId); // The first chunk in typeList should be ResTableTypeSpecChunk
|
||||||
|
if(typeList == null) {
|
||||||
|
System.out.println("¯¯ typeList is null, this is sus...");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (int i = 1; i < typeList.size(); ++i) {
|
for (int i = 1; i < typeList.size(); ++i) {
|
||||||
if (typeList.get(i) instanceof ResTableTypeInfoChunk) {
|
if (typeList.get(i) instanceof ResTableTypeInfoChunk) {
|
||||||
ResTableTypeInfoChunk x = (ResTableTypeInfoChunk) typeList.get(i);
|
ResTableTypeInfoChunk x = (ResTableTypeInfoChunk) typeList.get(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user