Fix error handling when project state is empty

Before this change, an unexpected exception
java.util.NoSuchElementException was thrown when the project state is
empty, then Resolver could not handle this exception and this causes
a Server Error. To fix this issue, a present check was added
before the project state check.

Bug: Issue 13492
Change-Id: I40a128bba8a0794b7daeb019ef0f75cefedef342
(cherry picked from commit a33c8b8d61b778f8ca84196b1a7cc1fd4fe24946)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/gitiles/FilteredRepository.java b/src/main/java/com/googlesource/gerrit/plugins/gitiles/FilteredRepository.java
index 59c537a..218703e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/gitiles/FilteredRepository.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/gitiles/FilteredRepository.java
@@ -69,7 +69,7 @@
     FilteredRepository create(Project.NameKey name)
         throws NoSuchProjectException, IOException, PermissionBackendException {
       Optional<ProjectState> projectState = projectCache.get(name);
-      if (!projectState.get().statePermitsRead()) {
+      if (!projectState.isPresent() || !projectState.get().statePermitsRead()) {
         throw new NoSuchProjectException(name);
       }
       return new FilteredRepository(