Skip to content

Commit

Permalink
open editors: null guard
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Jan 23, 2019
1 parent edb64a3 commit 6d8259c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,13 @@ class OpenEditorsDragAndDrop implements IListDragAndDrop<OpenEditor | IEditorGro
}

getDragURI(element: OpenEditor | IEditorGroup): string | null {
return element instanceof OpenEditor ? element.getResource().toString() : null;
if (element instanceof OpenEditor) {
const resource = element.getResource();
if (resource) {
return resource.toString();
}
}
return null;
}

getDragLabel?(elements: (OpenEditor | IEditorGroup)[]): string {
Expand Down

0 comments on commit 6d8259c

Please sign in to comment.