(defun company-clang--annotation (candidate)
(let ((ann (company-clang--annotation-1 candidate)))
- (if (not (string-prefix-p "(*)" ann))
+ (if (not (and ann (string-prefix-p "(*)" ann)))
ann
(with-temp-buffer
(insert ann)
(ert-deftest company-clang-func-ptr-annotation ()
(let ((str (propertize "foo" 'meta "void (*)(int) foo")))
(should (equal (company-clang 'annotation str) "(*)(int)"))))
+
+(ert-deftest company-clang-null-annotation ()
+ (let ((str "char"))
+ (should (null (company-clang 'annotation str)))))