Skip to content

Commit

Permalink
Fix crash on showing Routing tab [closes #1624]
Browse files Browse the repository at this point in the history
  • Loading branch information
schwabe committed Jul 16, 2023
1 parent 46dd6fe commit 1fc6b17
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main/src/ui/java/de/blinkt/openvpn/fragments/Settings_IP.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,21 @@ class Settings_IP : OpenVpnPreferencesFragment(), Preference.OnPreferenceChangeL

// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.vpn_ipsettings)
bindPreferences()
loadSettings()
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
/* Bind the preferences early to avoid loadingSetting which is called
* from the superclass to access an uninitialised earlyinit property
*/
bindPreferences()
super.onViewCreated(view, savedInstanceState)
}

override fun onBindPreferences() {
super.onBindPreferences()
bindPreferences()
loadSettings()
}

private fun bindPreferences() {
mIPv4 = findPreference("ipv4_address")!!
mIPv6 = findPreference("ipv6_address")!!
Expand Down

0 comments on commit 1fc6b17

Please sign in to comment.