Commit e9760417 authored by Egor.Ushakov's avatar Egor.Ushakov
Browse files

avoid exceptions on getContainingFile()

parent 933c8d74
Showing with 3 additions and 5 deletions
+3 -5
......@@ -170,17 +170,15 @@ public class AlternativeSourceNotificationProvider extends EditorNotifications.P
final DebuggerContextImpl context = DebuggerManagerEx.getInstanceEx(project).getContext();
final DebuggerSession session = context.getDebuggerSession();
final PsiClass item = ((ComboBoxClassElement)switcher.getSelectedItem()).myClass;
if (session != null) {
final VirtualFile vFile = item.getContainingFile().getVirtualFile();
if (session != null && vFile != null) {
session.getProcess().getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
StackFrameProxyImpl proxy = context.getFrameProxy();
Location location = proxy != null ? proxy.location() : null;
if (location != null) {
VirtualFile vFile = item.getContainingFile().getVirtualFile();
if (vFile != null) {
DebuggerUtilsEx.setAlternativeSourceUrl(location.declaringType().name(), vFile.getUrl(), project);
}
DebuggerUtilsEx.setAlternativeSourceUrl(location.declaringType().name(), vFile.getUrl(), project);
}
DebuggerUIUtil.invokeLater(new Runnable() {
@Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment