udp: keep coverity happy by explicitly preventing null-returns
authorFelix Dörre <felix@dogcraft.de>
Sun, 19 Mar 2017 16:30:59 +0000 (17:30 +0100)
committerFelix Dörre <felix@dogcraft.de>
Sun, 19 Mar 2017 21:11:45 +0000 (22:11 +0100)
Change-Id: I34e6379b1b4c3d9c6bfa5d69dcd127b1886a15b4

tests/club/wpia/gigi/testUtils/BusinessTest.java

index 31d3b09..727310d 100644 (file)
@@ -22,8 +22,8 @@ import club.wpia.gigi.dbObjects.Domain;
 import club.wpia.gigi.dbObjects.EmailAddress;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.NamePart;
-import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.NamePart.NamePartType;
+import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.email.EmailProvider;
 import club.wpia.gigi.ping.PingerDaemon;
 import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
@@ -76,11 +76,16 @@ public abstract class BusinessTest extends ConfiguredTest {
 
         @Override
         public TestMail receive() {
+            TestMail poll;
             try {
-                return mails.poll(30, TimeUnit.SECONDS);
+                poll = mails.poll(30, TimeUnit.SECONDS);
             } catch (InterruptedException e) {
                 throw new Error(e);
             }
+            if (poll == null) {
+                throw new AssertionError("Mail receiving timed out");
+            }
+            return poll;
         }
 
         @Override