Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/peek #4132

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.tencent.mtt.hippy.HippyGlobalConfigs;
import com.tencent.mtt.hippy.utils.LogUtils;
import com.tencent.mtt.hippy.utils.UIThreadUtils;
import java.util.EmptyStackException;
import java.util.HashMap;
import java.util.Stack;

Expand Down Expand Up @@ -214,7 +215,7 @@ public void run() {
if (mExceptionDialog != null && mExceptionDialog.isShowing()) {
return;
}
DevFloatButton button = mDevButtonStack.peek();
DevFloatButton button = (mDevButtonStack.size() > 0) ? mDevButtonStack.peek() : null;
if (button != null) {
mExceptionDialog = new DevExceptionDialog(button.getContext());
mExceptionDialog.handleException(throwable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,9 @@ public VirtualNode createVirtualNode(int rootId, int id, int pid, int index,
@NonNull String className,
@Nullable Map<String, Object> props) {
HippyViewController<?> controller = mControllerRegistry.getViewController(className);
if (controller != null) {
return controller.createVirtualNode(rootId, id, pid, index, props);
Renderer renderer = mRendererWeakRef.get();
if (controller != null && renderer instanceof NativeRender) {
return controller.createVirtualNode(rootId, id, pid, index, props, (NativeRender) renderer);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ protected RenderNode createRenderNode(int rootId, int id, @Nullable Map<String,
@SuppressWarnings("unused")
@Nullable
public VirtualNode createVirtualNode(int rootId, int id, int pid, int index,
@Nullable Map<String, Object> props) {
@Nullable Map<String, Object> props, @NonNull NativeRender nativeRender) {
// The host can create customize virtual node in a derived class.
return null;
}
Expand Down
Loading