Don't report an error when Fresco is not initialized yet and Flipper queries data
Summary: We shouldn't report an error when Flipper is querying data before Fresco is initialized. This will be especially useful when we move to lazy Fresco initialization later this year. Reviewed By: passy Differential Revision: D33978177 fbshipit-source-id: dfb6cb1b73737adbb557ecb141b043d088b5a574
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4b6fcb6aaf
commit
6960196d8e
@@ -145,7 +145,7 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
new FlipperReceiver() {
|
||||
@Override
|
||||
public void onReceive(FlipperObject params, FlipperResponder responder) throws Exception {
|
||||
if (!ensureFrescoInitialized(responder)) {
|
||||
if (!ensureFrescoInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
new FlipperReceiver() {
|
||||
@Override
|
||||
public void onReceive(FlipperObject params, FlipperResponder responder) throws Exception {
|
||||
if (!ensureFrescoInitialized(responder)) {
|
||||
if (!ensureFrescoInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
@Override
|
||||
public void onReceive(FlipperObject params, final FlipperResponder responder)
|
||||
throws Exception {
|
||||
if (!ensureFrescoInitialized(responder)) {
|
||||
if (!ensureFrescoInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
new FlipperReceiver() {
|
||||
@Override
|
||||
public void onReceive(FlipperObject params, FlipperResponder responder) {
|
||||
if (!ensureFrescoInitialized(responder)) {
|
||||
if (!ensureFrescoInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
new FlipperReceiver() {
|
||||
@Override
|
||||
public void onReceive(FlipperObject params, FlipperResponder responder) throws Exception {
|
||||
if (!ensureFrescoInitialized(responder)) {
|
||||
if (!ensureFrescoInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
new FlipperReceiver() {
|
||||
@Override
|
||||
public void onReceive(FlipperObject params, FlipperResponder responder) throws Exception {
|
||||
if (!ensureFrescoInitialized(responder)) {
|
||||
if (!ensureFrescoInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -457,13 +457,12 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin
|
||||
.build();
|
||||
}
|
||||
|
||||
private boolean ensureFrescoInitialized(FlipperResponder responder) {
|
||||
private boolean ensureFrescoInitialized() {
|
||||
mPerfLogger.startMarker("Sonar.Fresco.ensureFrescoInitialized");
|
||||
try {
|
||||
Fresco.getImagePipelineFactory();
|
||||
return true;
|
||||
} catch (NullPointerException e) {
|
||||
respondError(responder, "Fresco is not initialized yet");
|
||||
return false;
|
||||
} finally {
|
||||
mPerfLogger.endMarker("Sonar.Fresco.ensureFrescoInitialized");
|
||||
|
||||
Reference in New Issue
Block a user