Fixes crash while closing split view.
This is not a proper crash, but a "help needed". When opening kate a KTextEditor::View is created:
Adding KTextEditor::ViewPrivate(0x555b03997300)
After a split is created, instead of one view, I get two:
Adding KTextEditor::ViewPrivate(0x555b03a42100)
Adding KTextEditor::ViewPrivate(0x555b03ac0c00)
Then I close the split view:
Removing KTextEditor::ViewPrivate(0x555b03ac0c00)
Removing KTextEditor::ViewPrivate(0x555b03a42100)
and crash, because the map does not contains KTextEditor::ViewPrivate(0x555b03a42100)
I guess something is triggering the document to be added twice in the tabbar, and when this happens two views are created overriding the older pointer in the map.
This "fix" is just checking if something exists before trying to delete it.
Edited by Tomaz Canabrava