default to frontmost presented VC if controller is nil

It's possible that UIApplication.sharedApplication.keyWindow.rootViewController already modally presented another viewController. Therefore the default VC should be the frontmost presented VC of the rootViewController