Again, please don't do this, PluginOutput and Plugin should always contain something and we always want to save the plugin report, even if things go wrong.
If you found a situation where PluginOutput or Plugin are empty, the problem is not here, it is somewhere before and THAT is what needs to be fixed, not THIS :).

You are almost there, this is great for a first try!