Fix NPE when submitting error occurred during import. (rebased onto develop)



This is the same as gh-619 but rebased onto develop.

----

Regression. Should be tested and included before release See https://trac.openmicroscopy.org.uk/ome/ticket/10160