title: Android MotionLayout crashes when migrating from alpha-2 to alpha-3
body: <p>I'm playing with MotionLayout and got a strange issue</p>
  
  <p>When i changed used library version from <code>com.android.support.constraint:constraint-layout:2.0.0-alpha2</code> to <code>com.android.support.constraint:constraint-layout:2.0.0-alpha3</code></p>
  
  <p>my app crashed:</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
  Process: ru.sergik.collapsibleexoplayer, PID: 1376
  java.lang.NullPointerException: Attempt to invoke virtual method 'int androidx.constraintlayout.motion.widget.MotionScene.getDuration()' on a null object reference
      at androidx.constraintlayout.motion.widget.MotionLayout.dispatchDraw(MotionLayout.java:1634)
      at android.view.View.updateDisplayListIfDirty(View.java:19306)
      at android.view.View.draw(View.java:20093)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
      at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2072)
      at android.view.View.updateDisplayListIfDirty(View.java:19306)
      at android.view.View.draw(View.java:20093)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
      at android.view.View.updateDisplayListIfDirty(View.java:19306)
      at android.view.View.draw(View.java:20093)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
      at android.view.View.updateDisplayListIfDirty(View.java:19306)
      at android.view.View.draw(View.java:20093)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
      at android.view.View.updateDisplayListIfDirty(View.java:19306)
      at android.view.View.draw(View.java:20093)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
      at android.view.View.updateDisplayListIfDirty(View.java:19306)
      at android.view.View.draw(View.java:20093)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
      at android.view.View.draw(View.java:20373)
      at com.android.internal.policy.DecorView.draw(DecorView.java:980)
      at android.view.View.updateDisplayListIfDirty(View.java:19315)
      at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
      at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
      at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:800)
      at android.view.ViewRootImpl.draw(ViewRootImpl.java:3496)
      at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3283)
      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2818)
      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1780)
      at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7827)
      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
      at android.view.Choreographer.doCallbacks(Choreographer.java:723)
      at android.view.Choreographer.doFrame(Choreographer.java:658)
      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
      at android.os.Handler.handleCallback(Handler.java:789)
      at android.os.Handler.dispatchMessage(Handler.java:98)
      at android.os.Looper.loop(Looper.java:164)
      at android.app.ActivityThread.main(ActivityThread.java:6944)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
  </code></pre>
  
  <p>Doing some debugging i found some differences in versions of MotionLayout causing this crash:</p>
  
  <p><a href="https://i.stack.imgur.com/4nDxs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4nDxs.png" alt="MotionLayout alpha-3"></a></p>
  
  <p><a href="https://i.stack.imgur.com/zJZsG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zJZsG.png" alt="MotionLayout alpha-2"></a></p>
  
  <p>As you can see in alpha-3 <code>this.mDevModeDraw.draw(canvas, this.mFrameArrayList, this.mScene.getDuration(), this.mDebugPath);</code> will be called and cause crash when trying to get motion scene duration <code>this.mScene.getDuration()</code>, but in alpha-2 it wont be called due to different if condition.</p>
  
  <p>How should I solve this?</p>