Skip to content

Crash when trying to open HTTPS-by-default settings

Taslim Oseni requested to merge fix/https-by-default-crash into develop

This MR addresses issue #99 (closed).

The reported crash was happening because onCreateView() was getting called before onCreate(), thus leaving the webExtensionId variable uninitialized. This particular lifecycle sequence is a possibility in the FragmentActivity class (which AppCompatActivity extends). My fix was to re-initialize the webExtensionId variable in the onCreateView() function.

PS: I also checked to make sure this pattern (initializing a class-scoped variable in onCreate() and using it in onCreateView()) doesn't exist in any of the other activities where we call onCreateView(). Fortunately, this is the only occurrence.

Merge request reports