diff --git a/platform/util/src/com/intellij/util/io/PagedFileStorage.java b/platform/util/src/com/intellij/util/io/PagedFileStorage.java index 6a6c14671010..a8acc9b21219 100644 --- a/platform/util/src/com/intellij/util/io/PagedFileStorage.java +++ b/platform/util/src/com/intellij/util/io/PagedFileStorage.java @@ -173,7 +173,9 @@ public class PagedFileStorage implements Forceable { @NotNull private ByteBufferWrapper createValue(Integer key) { checkThreadAccess(); - PagedFileStorage owner = getRegisteredPagedFileStorageByIndex(key & FILE_INDEX_MASK); + final int storageIndex = key & FILE_INDEX_MASK; + PagedFileStorage owner = getRegisteredPagedFileStorageByIndex(storageIndex); + assert owner != null: "No storage for index " + storageIndex; int off = (key & MAX_PAGES_COUNT) * owner.myPageSize; if (off > owner.length()) { throw new IndexOutOfBoundsException("off=" + off + " key.owner.length()=" + owner.length());