Using system.gui.getDesktopHandles()

I am opening several desktops on different monitors. That part is working. What I am now trying is to check to see if a desktop is open all ready so I do not get an error if they try and open it again or if it is not open, to go ahead and open the desktop. Not that experienced with writing code like this. Any help would be helpful.