I am currently on H4 EAD which is valid until OCT 2019. My employer is filing my H1b this year in April.

Lets say my i didnot hear if my lottery went through and my application is accepted/rejected by USCIS for H1b until July(I have had some of my friends who got lottery rejected news in DEC). Can i file my H4 EAD renewal in JULY? Is it safe/okay to file this application while my h1b is being processed? Since my current h4 ead validity ends in oct, i donot want any gaps between my visa changes and loose both of the work permits. Please help. Thanks in advance.