## 🐛 Bug Report

Running with java binding and Firefox, the framework occasionally throws NullPointerException on the isDisplayed call.

**Please see https://github.com/mozilla/geckodriver/issues/1825 for more information.** As stated from geckodriver team, the issue is apparently related to the custom JS that is executed with this method. The ticket also contains trace logs. 

## To Reproduce

Hard to provide steps, as it happens "randomly".

## Expected behavior

Should not throw exception..

## Environment

OS: Windows 10
Browser: Firefox
Browser version: 84.0.1
Browser Driver version: geckodriver 0.28.0 (c00d2b6acd3f 2020-11-03 16:29 +0200)
Language Bindings version: java 3.141.59

public void sendKeys(CharSequence... keysToSend) {
    if (keysToSend == null || keysToSend.length == 0) {
      throw new IllegalArgumentException("Keys to send should be a not null CharSequence");
    }
    for (CharSequence cs : keysToSend) {
      if (cs == null) {
        throw new IllegalArgumentException("Keys to send should be a not null CharSequence");
      }
    }
    String allKeysToSend = String.join("", keysToSend);
    List<File> files = Arrays.stream(allKeysToSend.split("\n"))
      .map(fileDetector::getLocalFile)
      .collect(Collectors.toList());
    if (!files.isEmpty() && !files.contains(null)) {
      allKeysToSend = files.stream()
        .map(this::upload)
        .collect(Collectors.joining("\n"));
    }
    execute(DriverCommand.SEND_KEYS_TO_ELEMENT(id, new CharSequence[]{allKeysToSend}));
  }
  private String upload(File localFile) {
    if (!localFile.isFile()) {
      throw new WebDriverException("You may only upload files: " + localFile);
    }
    try {
      String zip = Zip.zip(localFile);
      Response response = execute(DriverCommand.UPLOAD_FILE(zip));
      return (String) response.getValue();
    } catch (IOException e) {
      throw new WebDriverException("Cannot upload " + localFile, e);