Skip to content

Commit eddc22d

Browse files
committed
android: fix potential _view null pointer exception.
1 parent ee22202 commit eddc22d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

android/app/src/main/java/com/btsplusplus/fowallet/FragmentVoting.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ class FragmentVoting : BtsppFragment() {
191191
}
192192

193193
// 刷新界面
194-
refreshUI()
194+
waitingOnCreateView().then {
195+
refreshUI()
196+
}
195197
}
196198

197199
private fun createHeaderView(ctx: Context, text: String, hasTip: Boolean, auxArgs: JSONObject): LinearLayout {
@@ -715,7 +717,7 @@ class FragmentVoting : BtsppFragment() {
715717

716718
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
717719
savedInstanceState: Bundle?): View? {
718-
720+
super.onCreateView(inflater, container, savedInstanceState)
719721
_ctx = inflater.context
720722
_view = inflater.inflate(R.layout.fragment_voting, container, false)
721723
return _view

0 commit comments

Comments
 (0)