Invoke loop only for new BGs from active BG source.

This commit is contained in:
Johannes Mockenhaupt 2018-03-17 13:31:26 +01:00
parent ad3bf19e4c
commit 8849df639f
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -159,7 +159,11 @@ public class LoopPlugin implements PluginBase {
@Subscribe
public void onStatusEvent(final EventAutosensCalculationFinished ev) {
if (ev.cause instanceof EventNewBG && ((EventNewBG) ev.cause).isNew) {
if (!(ev.cause instanceof EventNewBG))
return;
EventNewBG bgEv = (EventNewBG) ev.cause;
if (bgEv.isNew && bgEv.isActiveBgSource) {
invoke("New BG", true);
}
}