Fix exception in MatrixBuild.java:371

Happens when build has no parent:

15:06:14 FATAL: null
15:06:14 java.lang.NullPointerException
15:06:14    at hudson.matrix.MatrixBuild$MatrixBuildExecution.doRun(MatrixBuild.java:371)
15:06:14    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
15:06:14    at hudson.model.Run.execute(Run.java:1575)
15:06:14    at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
15:06:14    at hudson.model.ResourceController.execute(ResourceController.java:88)
15:06:14    at hudson.model.Executor.run(Executor.java:237)
15:06:14    at hudson.model.OneOffExecutor.run(OneOffExecutor.java:66)
Fix exception in DefaultMatrixExecutionStrategyImpl.java:253

Happens when a build has no parent:

15:29:46 FATAL: null
15:29:46 java.lang.NullPointerException
15:29:46    at hudson.matrix.DefaultMatrixExecutionStrategyImpl.waitForCompletion(DefaultMatrixExecutionStrategyImpl.java:253)
15:29:46    at hudson.matrix.DefaultMatrixExecutionStrategyImpl.run(DefaultMatrixExecutionStrategyImpl.java:164)
15:29:46    at hudson.matrix.MatrixBuild$MatrixBuildExecution.doRun(MatrixBuild.java:355)
15:29:46    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
15:29:46    at hudson.model.Run.execute(Run.java:1575)
15:29:46    at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
15:29:46    at hudson.model.ResourceController.execute(ResourceController.java:88)
15:29:46    at hudson.model.Executor.run(Executor.java:237)
15:29:46    at hudson.model.OneOffExecutor.run(OneOffExecutor.java:66)