Skip to content

Commit

Permalink
[sre] Avoid NPE on the event bus listener when stoping the agent.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Mar 9, 2020
1 parent eac8574 commit 145ed53
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -257,6 +257,9 @@ final class AgentLife {
assert dyingAgent !== null

try {
// Copy the external event listener in order to unregistered it later.
var listener = this.eventBus.associatedEventBusListener

// Pre-stage for uninstalling the skills (BIC and user defined)
var skills : CopyOnWriteArraySet<? extends Skill>
try {
Expand Down Expand Up @@ -289,9 +292,6 @@ final class AgentLife {

enclosingContextsCopy += contexts

// Copy the external event listener in order to unregistered it later.
var listener = this.eventBus.associatedEventBusListener

// Final stage for uninstalling the skills (BIC and user defined)
try {
skillUninstaller.uninstallSkillsAfterDestroy(dyingAgent, skills)
Expand Down

0 comments on commit 145ed53

Please sign in to comment.