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).
nit: missing space afterif