File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/org/tron/core Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ public static boolean addressValid(ByteString bsAddress) {
131131 }
132132
133133 public static boolean addressValid (byte [] address ) {
134+ if (address == null || address .length == 0 ) {
135+ logger .warn ("Warning: Address is empty !!" );
136+ return false ;
137+ }
134138 if (address .length != Constant .ADDRESS_SIZE / 2 ) {
135139 logger .warn (
136140 "Warning: Address length need " + Constant .ADDRESS_SIZE + " but " + address .length
@@ -147,6 +151,10 @@ public static boolean addressValid(byte[] address) {
147151 }
148152
149153 public static boolean addressValid (String addressStr ) {
154+ if (addressStr == null || "" .equals (addressStr )) {
155+ logger .warn ("Warning: Address is empty !!" );
156+ return false ;
157+ }
150158 try {
151159 byte [] address = ByteArray .fromHexString (addressStr );
152160 return addressValid (address );
You can’t perform that action at this time.
0 commit comments