]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Report error for error-domains without any code
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 12 Jul 2018 09:33:57 +0000 (11:33 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 12 Jul 2018 09:36:38 +0000 (11:36 +0200)
vala/valaerrordomain.vala

index 1c63e51f39befdff4266723cefd4f752198fa92f..c0e92e70e69bbcf07d5fce3a24ebd30a9e646a10 100644 (file)
@@ -114,6 +114,12 @@ public class Vala.ErrorDomain : TypeSymbol {
 
                checked = true;
 
+               if (codes.size <= 0) {
+                       Report.error (source_reference, "Error domain `%s' requires at least one code".printf (get_full_name ()));
+                       error = true;
+                       return false;
+               }
+
                foreach (ErrorCode ecode in codes) {
                        ecode.check (context);
                }