From 689ae2a8baa1ca4874a508a7ae5a39f57f369cef Mon Sep 17 00:00:00 2001 From: grog Date: Sun, 5 Nov 2023 07:18:08 -0800 Subject: [PATCH] fixed npe in onPirOn --- src/main/java/org/myrobotlab/service/InMoov2.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index 247d8d37db..bd794195b8 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -927,10 +927,13 @@ public void onPirOn() { led.interval = 500; // FIXME flash on config.flashOnBoot invoke("publishFlash"); - String botState = chatBot.getPredicate("botState"); - if ("sleeping".equals(botState)) { - invoke("publishEvent", "WAKE"); - } + ProgramAB chatBot = (ProgramAB)getPeer("chatBot"); + if (chatBot != null) { + String botState = chatBot.getPredicate("botState"); + if ("sleeping".equals(botState)) { + invoke("publishEvent", "WAKE"); + } + } } // GOOD GOOD GOOD - LOOPBACK - flexible and replacable by python