Avoid crash in showEditDialog if there is no patch
When instantiated by the plugin factory there is no patch available,
so a null pointer is used. Immediately after instantiation the tool
view is shown, which causes an attempt to access members through the
null pointer.
BUG: 306176
REVIEW: 108728