Author: sebb
Date: Fri Sep 11 11:10:49 2015
New Revision: 1702427

URL: http://svn.apache.org/r1702427
Log:
Avoid NPE

Modified:
    
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java

Modified: 
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
URL: 
http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java?rev=1702427&r1=1702426&r2=1702427&view=diff
==============================================================================
--- 
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
 (original)
+++ 
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
 Fri Sep 11 11:10:49 2015
@@ -158,7 +158,7 @@ public abstract class FieldOrMethod exte
      */
     public final void setAttributes( Attribute[] attributes ) {
         this.attributes = attributes;
-        this.attributes_count = attributes.length; // init deprecated field
+        this.attributes_count = attributes != null ? attributes.length : 0; // 
init deprecated field
     }
 
 


Reply via email to