Skip to content
Snippets Groups Projects
Commit c258f1da authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Prevent crashes for the Video player info component

parent a89d6e7b
No related branches found
No related tags found
1 merge request!1070Beta fixes
Pipeline #127175 passed with stage
in 4 minutes
......@@ -71,10 +71,12 @@ class LegendView : ConstraintLayout, PlotViewDataChangeListener {
override fun onAttachedToWindow() {
super.onAttachedToWindow()
//workaround for editor
if (!isInEditMode && context != null) {
plotView = (context as Activity).findViewById(plotViewId)
if (!::plotView.isInitialized) throw IllegalStateException("A valid plot view has to be provided")
plotView.addListener(this)
if (!isInEditMode) {
context?.let {
plotView = (it as Activity).findViewById(plotViewId)
if (!::plotView.isInitialized) throw IllegalStateException("A valid plot view has to be provided")
plotView.addListener(this)
}
}
layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment