diff --git a/src/ui/list_view.js b/src/ui/list_view.js
index <HASH>..<HASH> 100644
--- a/src/ui/list_view.js
+++ b/src/ui/list_view.js
@@ -117,6 +117,9 @@ base.exportTo('ui', function() {
     },
 
     onKeyDown_: function(e) {
+      if (this.selectedElement === undefined)
+        return;
+
       if (e.keyCode == 38) { // Up arrow.
         var prev = this.selectedElement.previousSibling;
         if (prev) {
Prevent exception when key is pressed with no selection in list view

The picture ops list view extends list_view's functionality to support
deselecting if a selected element is clicked twice. If a key is pressed
in this case, an exception would be thrown because list_view assumes
there is a selected element.

This patch just checks that this.selectedElement is defined in the key
event listener.

TBR=nduca

Review URL: <URL>