fixed bug due to simultaneous merge w green
authorbb3dan <github@bb3systems.com>
Fri, 18 Oct 2013 04:25:42 +0000 (21:25 -0700)
committerbb3dan <github@bb3systems.com>
Fri, 18 Oct 2013 04:25:42 +0000 (21:25 -0700)
DanUtil.pde

index 859b5187b709c80858fabd34b6bb51a2ac3aadfc..e475059b3082937da86d867acd9ed2659cfd770d 100644 (file)
@@ -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); } }