android fix npe
This commit is contained in:
parent
527c46c5ca
commit
75fbb3d527
@ -175,6 +175,9 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator {
|
|||||||
DoricJSLoaderManager.getInstance().loadJSBundle(source).setCallback(new AsyncResult.Callback<String>() {
|
DoricJSLoaderManager.getInstance().loadJSBundle(source).setCallback(new AsyncResult.Callback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResult(String result) {
|
public void onResult(String result) {
|
||||||
|
if (getActivity() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
doricPanel.config(result, alias, extra);
|
doricPanel.config(result, alias, extra);
|
||||||
DoricContext context = doricPanel.getDoricContext();
|
DoricContext context = doricPanel.getDoricContext();
|
||||||
context.setDoricNavigator(DoricPanelFragment.this);
|
context.setDoricNavigator(DoricPanelFragment.this);
|
||||||
@ -185,6 +188,9 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable t) {
|
public void onError(Throwable t) {
|
||||||
|
if (getActivity() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
DoricLog.e("DoricPanelFragment load JS error:" + t.getLocalizedMessage());
|
DoricLog.e("DoricPanelFragment load JS error:" + t.getLocalizedMessage());
|
||||||
showError();
|
showError();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user