File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
common/src/main/java/org/tron/common/args Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,17 @@ public void setAssets(final List<Account> assets) {
6161 */
6262 public void setTimestamp (final String timestamp ) {
6363 this .timestamp = timestamp ;
64-
6564 if (this .timestamp == null ) {
6665 this .timestamp = DEFAULT_TIMESTAMP ;
67- }
68-
69- try {
70- long l = Long .parseLong (this .timestamp );
71- if (l < 0 ) {
66+ } else {
67+ try {
68+ long l = Long .parseLong (this .timestamp );
69+ if (l < 0 ) {
70+ throw new IllegalArgumentException ("Timestamp(" + timestamp + ") must be greater than or equal to 0." );
71+ }
72+ } catch (NumberFormatException e ) {
7273 throw new IllegalArgumentException ("Timestamp(" + timestamp + ") must be a Long type." );
7374 }
74- } catch (NumberFormatException e ) {
75- throw new IllegalArgumentException ("Timestamp(" + timestamp + ") must be a Long type." );
7675 }
7776 }
7877
You can’t perform that action at this time.
0 commit comments