I have created some QGIS plugin using PyQGIS those plugins have different input layer methods, some work to get
layer by name from layer panel some plugin have
compo_box to define the user where layer want from layer panel of QGIS.
Those plugins have a some error, if the input layer is wrong or missing from layer panel then it crashes, but if I replace with correct layer without closing QGIS then again don't work with the some way keep the wrong layer again.
If I use
reload plugin and run the script with correct layer then plugin work correct.
But how to avoid to run all time
Can I have in my plugin some code to do re-reload every time the plugin running?