From e6cf897874172cf563cf7b1f537fdae50042f5ab Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 2 Sep 2022 15:47:28 +0200 Subject: [PATCH] =?UTF-8?q?Anpassen=20der=20geg.=20L=C3=B6sung=20an=20den?= =?UTF-8?q?=20Null-Testfall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SimpleActivityStack/src/solution/SimpleActivityStack.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SimpleActivityStack/src/solution/SimpleActivityStack.java b/SimpleActivityStack/src/solution/SimpleActivityStack.java index a183c0c..1d2a223 100644 --- a/SimpleActivityStack/src/solution/SimpleActivityStack.java +++ b/SimpleActivityStack/src/solution/SimpleActivityStack.java @@ -6,6 +6,9 @@ public class SimpleActivityStack extends SimpleStack { @Override public int push(SimpleActivity activity) { + if (activity == null) { + return 0; + } if (size() > 0) { super.get(size() - 1).passivate(); }