Skip to content
Closed
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 @@ -282,15 +282,29 @@ internal constructor(
return
}

val parentViewState = getViewState(parentTag)
val parentViewState = getNullableViewState(parentTag)
if (parentViewState == null) {
ReactSoftExceptionLogger.logSoftException(
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
ReactNoCrashSoftException("Unable to find viewState for tag: [$parentTag] for addViewAt"),
)
return
}
if (parentViewState.view !is ViewGroup) {
val message =
"Unable to add a view into a view that is not a ViewGroup. ParentTag: $parentTag - Tag: $tag - Index: $index"
FLog.e(TAG, message)
throw IllegalStateException(message)
}
val parentView = parentViewState.view as ViewGroup
val viewState = getViewState(tag)
val viewState = getNullableViewState(tag)
if (viewState == null) {
ReactSoftExceptionLogger.logSoftException(
ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
ReactNoCrashSoftException("Unable to find viewState for tag: [$tag] for addViewAt"),
)
return
}
val view = viewState.view
checkNotNull(view) { "Unable to find view for viewState $viewState and tag $tag" }

Expand Down
Loading