mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: fix possible NPE
This commit is contained in:
+3
-1
@@ -30,6 +30,7 @@ import com.intellij.openapi.vcs.*;
|
||||
import com.intellij.openapi.vcs.annotate.AnnotationProvider;
|
||||
import com.intellij.openapi.vcs.annotate.FileAnnotation;
|
||||
import com.intellij.openapi.vcs.changes.ContentRevision;
|
||||
import com.intellij.openapi.vcs.history.VcsFileRevision;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import com.intellij.openapi.vcs.vfs.ContentRevisionVirtualFile;
|
||||
import com.intellij.openapi.vcs.vfs.VcsVirtualFile;
|
||||
@@ -156,7 +157,8 @@ public class AnnotateVcsVirtualFileAction {
|
||||
VcsRevisionNumber revisionNumber = null;
|
||||
if (file instanceof VcsVirtualFile) {
|
||||
filePath = VcsUtil.getFilePath(file.getPath());
|
||||
revisionNumber = ((VcsVirtualFile)file).getFileRevision().getRevisionNumber();
|
||||
VcsFileRevision revision = ((VcsVirtualFile)file).getFileRevision();
|
||||
revisionNumber = revision != null ? revision.getRevisionNumber() : null;
|
||||
}
|
||||
else if (file instanceof ContentRevisionVirtualFile) {
|
||||
ContentRevision revision = ((ContentRevisionVirtualFile)file).getContentRevision();
|
||||
|
||||
Reference in New Issue
Block a user