Check if there is a current icon item in the device manager. Fixes #4604 #4555 

When we open the device properties dialog for the first time there is no selected icon so this segfault when we just click on OK. I just added a condition to be sure that *icon->currentItem* is not *null*.

(#4604 was a duplicate of #4555).
OTOH, `nullptr` enforces that the left-hand side is actually a pointer so we should probably prefer it in new code