Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from Agrimap/2.x
Browse files Browse the repository at this point in the history
Guard against lazy init of child fragment manager
  • Loading branch information
VictorAlbertos authored Jun 20, 2017
2 parents a9fd6d2 + fa2b814 commit ade5cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion rx_activity_result/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.VictorAlbertos'
version='0.4.1-2.x'
version='0.4.4-2.x'

android {
compileSdkVersion 25
Expand All @@ -28,3 +28,9 @@ dependencies {

testCompile 'junit:junit:4.12'
}

install {
repositories.mavenInstaller {
pom.artifactId = 'RxActivityResult'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Fragment getTargetFragment(List<Fragment> fragments) {
for (Fragment fragment : fragments) {
if (fragment != null && fragment.isVisible() && fragment.getClass() == clazz) {
return fragment;
} else if (fragment != null && fragment.getChildFragmentManager() != null) {
} else if (fragment != null && fragment.isAdded() && fragment.getChildFragmentManager() != null) {
List<Fragment> childFragments = fragment.getChildFragmentManager().getFragments();
Fragment candidate = getTargetFragment(childFragments);
if (candidate != null) return candidate;
Expand Down

0 comments on commit ade5cd2

Please sign in to comment.