Cherry-picking part of EventQueueUtilities from another branch.
Avoiding NPE on file Future.