kernclass: don't deref. NULL on empty chooser input

Fixes #1619.

r? @frank-trampe
My reasoning up here was that when you clicked Cancel with non-empty file chooser, it would go through the function anyway. 
But your patch did it at a larger scale that there's no need to rewind or even parse the data since user clicked on Cancel anyway. So I think that this solution was simpler than bypassing inside the function itself.