Fix file-handling interface bug.

Fix bug wherein clicking "Choose file ...", selecting a valid file, then
immediately clicking "Choose file ..." again and hitting cancel caused an
attribute lookup on undefined.