Fix NPE when no data to inject (only a simple python cmd for ptychography for example)