|  | @@ -14,11 +14,12 @@ import java.util.ArrayList;
 | 
	
		
			
			| 14 | 14 |  import java.util.EmptyStackException;
 | 
	
		
			
			| 15 | 15 |  import java.util.List;
 | 
	
		
			
			| 16 | 16 |  
 | 
	
		
			
			| 17 |  | -import javax.annotation.Nullable;
 | 
	
		
			
			| 18 |  | -
 | 
	
		
			
			|  | 17 | +import androidx.annotation.Nullable;
 | 
	
		
			
			| 19 | 18 |  import androidx.annotation.RestrictTo;
 | 
	
		
			
			| 20 | 19 |  import androidx.coordinatorlayout.widget.CoordinatorLayout;
 | 
	
		
			
			| 21 | 20 |  
 | 
	
		
			
			|  | 21 | +import static com.reactnativenavigation.utils.ObjectUtils.perform;
 | 
	
		
			
			|  | 22 | +
 | 
	
		
			
			| 22 | 23 |  public class ModalStack {
 | 
	
		
			
			| 23 | 24 |      private List<ViewController> modals = new ArrayList<>();
 | 
	
		
			
			| 24 | 25 |      private final ModalPresenter presenter;
 | 
	
	
		
			
			|  | @@ -82,9 +83,9 @@ public class ModalStack {
 | 
	
		
			
			| 82 | 83 |          }
 | 
	
		
			
			| 83 | 84 |      }
 | 
	
		
			
			| 84 | 85 |  
 | 
	
		
			
			| 85 |  | -    public void dismissAllModals(ViewController root, Options mergeOptions, CommandListener listener) {
 | 
	
		
			
			|  | 86 | +    public void dismissAllModals(@Nullable ViewController root, Options mergeOptions, CommandListener listener) {
 | 
	
		
			
			| 86 | 87 |          if (modals.isEmpty()) {
 | 
	
		
			
			| 87 |  | -            listener.onSuccess(root.getId());
 | 
	
		
			
			|  | 88 | +            listener.onSuccess(perform(root, "", ViewController::getId));
 | 
	
		
			
			| 88 | 89 |              return;
 | 
	
		
			
			| 89 | 90 |          }
 | 
	
		
			
			| 90 | 91 |          String topModalId = peek().getId();
 |