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(); }