Skip to content

Commit

Permalink
Merge pull request #2063 from Vip-Augus/master
Browse files Browse the repository at this point in the history
[ISSUE #2062]Add type check before convert
close #2062
  • Loading branch information
xwm1992 committed Nov 2, 2022
2 parents 0d5afaf + cfe94ac commit 94413d7
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -57,8 +57,9 @@ public void run() {
if (offset == null) {
CloudEvent message = standaloneBroker.getMessage(topicName);
if (message != null) {
if (message.getExtension("offset") != null) {
offset = new AtomicInteger((int) message.getExtension("offset"));
Object tmpOffset = message.getExtension("offset");
if (tmpOffset instanceof Integer) {
offset = new AtomicInteger(Integer.parseInt(tmpOffset.toString()));
} else {
offset = new AtomicInteger(0);
}
Expand Down Expand Up @@ -113,4 +114,4 @@ public void shutdown() {
isRunning = false;
}

}
}

0 comments on commit 94413d7

Please sign in to comment.