mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix NPE in diff
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -110,10 +110,11 @@ public class DiffApplication implements ApplicationStarterEx {
|
||||
final DirDiffSettings settings = new DirDiffSettings();
|
||||
settings.showInFrame = false;
|
||||
diffManager.showDiff(d1, d2, settings, null);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
file1.refresh(false, false);
|
||||
file2.refresh(false, false);
|
||||
SimpleDiffRequest request = SimpleDiffRequest.compareFiles(file1, file2, null);
|
||||
SimpleDiffRequest request = SimpleDiffRequest.compareFiles(file1, file2, ProjectManager.getInstance().getDefaultProject());
|
||||
request.addHint(DiffTool.HINT_SHOW_MODAL_DIALOG);
|
||||
DiffManager.getInstance().getIdeaDiffTool().show(request);
|
||||
FileDocumentManager.getInstance().saveAllDocuments();
|
||||
|
||||
@@ -62,9 +62,9 @@ public class SimpleDiffRequest extends DiffRequest {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static SimpleDiffRequest compareFiles(VirtualFile file1, VirtualFile file2, Project project) {
|
||||
return compareFiles(file1, file2, project,
|
||||
DiffBundle.message("compare.file.vs.file.dialog.title", file1.getPresentableUrl(), file2.getPresentableUrl()));
|
||||
public static SimpleDiffRequest compareFiles(@NotNull VirtualFile file1, @NotNull VirtualFile file2, @NotNull Project project) {
|
||||
final String title = DiffBundle.message("compare.file.vs.file.dialog.title", file1.getPresentableUrl(), file2.getPresentableUrl());
|
||||
return compareFiles(file1, file2, project, title);
|
||||
}
|
||||
|
||||
private static class FileDiffRequest extends SimpleDiffRequest {
|
||||
|
||||
Reference in New Issue
Block a user