* lisp/progmodes/hideif.el: Use lexical-binding. Fix up cl-lib usage.
[bpt/emacs.git] / src / nsselect.m
index 4cf81ed..038849c 100644 (file)
@@ -351,7 +351,7 @@ On Nextstep, FRAME is unused.  */)
   check_window_system (NULL);
   CHECK_SYMBOL (selection);
   if (NILP (value))
-      error ("selection value may not be nil.");
+    error ("Selection value may not be nil");
   pb = ns_symbol_to_pb (selection);
   if (pb == nil) return Qnil;
 
@@ -429,7 +429,9 @@ On Nextstep, TERMINAL is unused.  */)
   id pb;
   NSArray *types;
 
-  check_window_system (NULL);
+  if (!window_system_available (NULL))
+    return Qnil;
+
   CHECK_SYMBOL (selection);
   if (EQ (selection, Qnil)) selection = QPRIMARY;
   if (EQ (selection, Qt)) selection = QSECONDARY;