This is a good patch. This issue has bothered Kate for many years. I tested this patch and the black screen and unneccessary resize info widget is gone with this patch.
And not updating the size if either the width or the height is 0 (i.g. the contents rect is not valid) makes a lot of sense.
So a "Ship-It" from my side, although I'm not the maintainer. Maybe wait for another +1 before you commit.