From 97da4a7699c3db50dff66db9d44901badc0e9107 Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Tue, 25 Aug 2009 02:33:40 +0000 Subject: [PATCH] Check for nulls git-svn-id: https://smali.googlecode.com/svn/trunk@419 55b6fa8a-2a1e-11de-a435-ffa8d773f76a --- .../jf/dexlib/AnnotationDirectoryItem.java | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java b/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java index 4d157216..02ad386b 100644 --- a/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java +++ b/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java @@ -219,40 +219,49 @@ public class AnnotationDirectoryItem extends Item { out.annotate(4, "class_annotations_off:"); } - out.annotate(4, "annotated_fields_size: 0x" + Integer.toHexString(fieldAnnotations.length) + " (" + - fieldAnnotations.length + ")"); - out.annotate(4, "annotated_methods_size: 0x" + Integer.toHexString(methodAnnotations.length) + " (" + - methodAnnotations.length + ")"); - out.annotate(4, "annotated_parameters_size: 0x" + Integer.toHexString(parameterAnnotations.length) + " (" + - parameterAnnotations.length + ")"); + int length = fieldAnnotations==null?0:fieldAnnotations.length; + out.annotate(4, "annotated_fields_size: 0x" + Integer.toHexString(length) + " (" + + length + ")"); + length = methodAnnotations==null?0:methodAnnotations.length; + out.annotate(4, "annotated_methods_size: 0x" + Integer.toHexString(length) + " (" + + length + ")"); + length = parameterAnnotations==null?0:parameterAnnotations.length; + out.annotate(4, "annotated_parameters_size: 0x" + Integer.toHexString(length) + " (" + + length + ")"); + int index; + if (fieldAnnotations != null) { + index = 0; + for (int i=0; i