Add logging for
@@ -67,6 +67,7 @@ public class CompositionLayer extends BaseLayer {
for (int i = 0; i < layerMap.size(); i++) {
long key = layerMap.keyAt(i);
BaseLayer layerView = layerMap.get(key);
+ assertNonNullForGitHubIssue(layerMap, layerView);
BaseLayer parentLayer = layerMap.get(layerView.getLayerModel().getParentId());
if (parentLayer != null) {
layerView.setParentLayer(parentLayer);
@@ -74,6 +75,20 @@ public class CompositionLayer extends BaseLayer {
}
}
+ /**
+ * Extra logging for https://github.com/airbnb/lottie-android/issues/524
+ */
+ private void assertNonNullForGitHubIssue(
+ LongSparseArray<BaseLayer> layerMap, BaseLayer layerView) {
+ if (layerMap == null) {
+ throw new NullPointerException("layerMap is null!");
+ } else if (layerView == null) {
+ throw new NullPointerException("layerView is null!");
+ } else if (layerView.getLayerModel() == null) {
+ throw new NullPointerException("layerModel is null!");
+ }
+ }
+
@Override void drawLayer(Canvas canvas, Matrix parentMatrix, int parentAlpha) {
L.beginSection("CompositionLayer#draw");
canvas.save();
