Commit 2995ccdf authored by Anon's avatar Anon
Browse files

MainFragment: Fix NPE.

parent df2f98ea
...@@ -89,6 +89,11 @@ class MainFragment : Fragment(), GattListener { ...@@ -89,6 +89,11 @@ class MainFragment : Fragment(), GattListener {
} }
private fun showConnectedView() { private fun showConnectedView() {
// The callback can happen when our UI is not visible
if (container_connected == null) {
return
}
activity?.runOnUiThread { activity?.runOnUiThread {
container_connected.visibility = View.VISIBLE container_connected.visibility = View.VISIBLE
container_disconnected.visibility = View.GONE container_disconnected.visibility = View.GONE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment