Fix the FlipperArray creation of events

Summary:
The FlipperArray creation from JSONArray used to create an array of `null`'s instead of the FlipperObject, which used to crash the Flipper. Thus added a check in the flipper to not crash in the case when it receives array of nulls. Also fixed the Fresco plugin in mobile to send the proper FlipperArray.

Bug:

{F160049909}

Reviewed By: passy

Differential Revision: D15608297

fbshipit-source-id: 625e017d3bce4135ac699ee5aee8d871db378749
This commit is contained in:
Pritesh Nandgaonkar
2019-06-04 03:35:14 -07:00
committed by Facebook Github Bot
parent 95fae7d4e8
commit 62c112c713
2 changed files with 19 additions and 4 deletions

View File

@@ -175,12 +175,20 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
getImageData(
imageID, encodedBitmap, bitmap, mFlipperImageTracker.getUriString(cacheKey)));
}
responder.success(
FlipperArray.Builder arrayBuilder = new FlipperArray.Builder();
for (FlipperObject obj : mEvents) {
arrayBuilder.put(obj);
}
mEvents.clear();
FlipperObject object =
new FlipperObject.Builder()
.put("levels", levels)
.put("imageDataList", imageDataListBuilder.build())
.put("events", new FlipperArray(new JSONArray(mEvents)))
.build());
.put("events", arrayBuilder.build())
.build();
responder.success(object);
}
});
connection.receive(