Skip to content

Commit

Permalink
* [android] fix create body NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
sospartan committed Jun 12, 2016
1 parent 213c838 commit 89690f7
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions android/sdk/src/main/java/com/taobao/weex/dom/WXDomStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,23 +474,28 @@ void createBody(JSONObject element) {
domObject.ref = WXDomObject.ROOT;
domObject.updateStyle(style);
transformStyle(domObject, true);
final WXComponent component = mWXRenderManager.createBodyOnDomThread(mInstanceId, domObject);
AddDomInfo addDomInfo = new AddDomInfo();
addDomInfo.component = component;
mAddDom.put(domObject.ref, addDomInfo);

mNormalTasks.add(new IWXRenderTask() {
try {
final WXComponent component = mWXRenderManager.createBodyOnDomThread(mInstanceId, domObject);
AddDomInfo addDomInfo = new AddDomInfo();
addDomInfo.component = component;
mAddDom.put(domObject.ref, addDomInfo);

@Override
public void execute() {
mWXRenderManager.createBody(mInstanceId, component);
}
});
mDirty = true;
mFlushes.add(domObject.ref);
mNormalTasks.add(new IWXRenderTask() {

if (instance != null) {
instance.commitUTStab(WXConst.DOM_MODULE, WXErrorCode.WX_SUCCESS);
@Override
public void execute() {
mWXRenderManager.createBody(mInstanceId, component);
}
});
mDirty = true;
mFlushes.add(domObject.ref);

if (instance != null) {
instance.commitUTStab(WXConst.DOM_MODULE, WXErrorCode.WX_SUCCESS);
}
}catch (Exception e){
WXLogUtils.e("create body failed."+e.getMessage());
}
}

Expand Down

0 comments on commit 89690f7

Please sign in to comment.