Skip to content

Commit

Permalink
Minor refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
shubertm committed Dec 28, 2023
1 parent 91499d5 commit f70651c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class FilePickerDialog: ArkFilePickerFragment() {

override fun dismiss() {
super.dismiss()
val activity = (requireActivity() as MainActivity)
if (activity.memoPreferences.getPathString() == null) activity.finish()
val activity = (activity as? MainActivity)
if (activity?.memoPreferences?.getPathString() == null) activity?.finish()
}

companion object{

private const val TAG = "file_picker"
private var fragmentManager: FragmentManager? = null
private lateinit var fragmentManager: FragmentManager
var readPermLauncher: ActivityResultLauncher<String>? = null
var readPermLauncher_SDK_R: ActivityResultLauncher<String>? = null

Expand All @@ -35,7 +35,7 @@ class FilePickerDialog: ArkFilePickerFragment() {
}

fun show() {
newInstance(getFilePickerConfig()).show(fragmentManager!!, TAG)
newInstance(getFilePickerConfig()).show(fragmentManager, TAG)
}

fun show(activity: AppCompatActivity, fragmentManager: FragmentManager){
Expand Down

0 comments on commit f70651c

Please sign in to comment.