title: Eclipse RCP: clonePerspective returns null
body: <p>I want to clone a perspective and save that cloned one. However, the call to the <a href="http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2FIPerspectiveRegistry.html" rel="nofollow"><code>PerspectiveRegistry.clonePerspective(...)</code></a> returns null, and I'm running out of ideas what could possibly be wrong with my parameter values.</p>
  
  <pre><code>public void savePerspectiveAs(String label) {
      IWorkbenchPage page = PlatformUI.getWorkbench()
              .getActiveWorkbenchWindow().getActivePage();
      IPerspectiveDescriptor perspectiveDescriptor = perspectiveRegistry
              .findPerspectiveWithLabel(label);
  
      // if the perspective doesn't exist, create a new one 
      // by cloning the current perspective
      if (perspectiveDescriptor == null) {
          IPerspectiveDescriptor currentPerspectiveDescriptor = 
                  perspectiveRegistry.findPerspectiveWithId(currentPerspective);
          // after this line, perspectiveDescriptor is still null
          perspectiveDescriptor = perspectiveRegistry
                  .clonePerspective(currentPerspective + "." 
                           + label.replaceAll(" ", "_"), label, 
                           currentPerspectiveDescriptor);
          // hence I get a NullPointerException here...
          connectedPerspectives.add(perspectiveDescriptor.getId());
      }
      page.savePerspectiveAs(perspectiveDescriptor);
  
  }
  </code></pre>
  
  <p>All other values seem to be fine. <code>currentPerspectiveDescriptor</code> is a valid object, so is <code>perspectiveRegistry</code>. </p>
  
  <p><code>label</code> is something like <code>"Connected Perspective 2"</code>. And it does not exist yet, neither does my created perspective ID.</p>
  
  <p>Any ideas? What could go wrong here for <code>clonePerspective(...)</code> to return null?</p>