Commit bc182caa60f93dbe090f2665eb6831f26a90542a
1 parent
6d4c54e2
Check if str 'isParsable' before trying to parse it in EntityDataAdapter
Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | */ |
16 | 16 | package org.thingsboard.server.dao.sql.query; |
17 | 17 | |
18 | +import org.apache.commons.lang3.math.NumberUtils; | |
18 | 19 | import org.thingsboard.server.common.data.EntityType; |
19 | 20 | import org.thingsboard.server.common.data.UUIDConverter; |
20 | 21 | import org.thingsboard.server.common.data.id.EntityId; |
... | ... | @@ -82,7 +83,7 @@ public class EntityDataAdapter { |
82 | 83 | if (value != null) { |
83 | 84 | String strVal = value.toString(); |
84 | 85 | // check number |
85 | - if (strVal.length() > 0) { | |
86 | + if (strVal.length() > 0 && NumberUtils.isParsable(strVal)) { | |
86 | 87 | try { |
87 | 88 | long longVal = Long.parseLong(strVal); |
88 | 89 | return Long.toString(longVal); | ... | ... |