diff --git a/platform/vfs-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerImpl.java b/platform/vfs-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerImpl.java index 169707946005..398d9babf763 100644 --- a/platform/vfs-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerImpl.java +++ b/platform/vfs-impl/src/com/intellij/openapi/vfs/impl/VirtualFilePointerImpl.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.vfs.impl; import com.intellij.openapi.application.ApplicationManager; @@ -66,7 +52,8 @@ class VirtualFilePointerImpl extends TraceableDisposable implements VirtualFileP public VirtualFile getFile() { FilePartNode node = checkDisposed(myNode); if (node == null) return null; - return FilePartNode.myFile(node.myFileOrUrl); + VirtualFile file = FilePartNode.myFile(node.myFileOrUrl); + return (file != null && file.isValid()) ? file : null; } @Override