Refactor security components to the Kernel
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / util / CmsUtils.java
index d8cd171e2d0441e1bcb0f62352314b3ea6cb95d2..439f48af195c082193796f7a29ee276375238a1f 100644 (file)
@@ -29,14 +29,17 @@ import org.eclipse.swt.widgets.Widget;
 
 /** Static utilities for the CMS framework. */
 public class CmsUtils implements CmsConstants {
-       /** The CMS view related to this display. */
+       /**
+        * The CMS view related to this display, or null if none is available from
+        * this call.
+        */
        public static CmsView getCmsView() {
                Display display = Display.getCurrent();
                if (display == null)
-                       throw new CmsException("No display available");
+                       return null;
                CmsView cmsView = (CmsView) display.getData(CmsView.KEY);
                if (cmsView == null)
-                       throw new CmsException("No CMS view available");
+                       return null;
                return cmsView;
        }