From: bb3dan Date: Fri, 18 Oct 2013 04:25:42 +0000 (-0700) Subject: fixed bug due to simultaneous merge w green X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ee1206f686f25042133c6458f2ccc59549382a7d;p=SugarCubes.git fixed bug due to simultaneous merge w green --- diff --git a/DanUtil.pde b/DanUtil.pde index 859b518..e475059 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -227,7 +227,8 @@ public class DPat extends SCPattern void StartRun(double deltaMs) { } color CalcPoint(xyz p) { return lx.hsb(0,0,0); } boolean IsActive() { return this == DG.CurPat; } - boolean IsFocused() { return this == midiEngine.getFocusedDeck().getActivePattern(); } + boolean IsFocused() { return midiEngine != null && midiEngine.getFocusedDeck() != null && + this == midiEngine.getFocusedDeck().getActivePattern(); } void onInactive() { UpdateState(); } void onActive () { UpdateState(); StartPattern(); } void UpdateState() { if (IsFocused() != IsActive()) { if (IsFocused()) DG.Activate(this); else DG.Deactivate(this); } }