diff --git a/src/main/java/jace/apple2e/Apple2e.java b/src/main/java/jace/apple2e/Apple2e.java index 3a6aed1..78aa601 100644 --- a/src/main/java/jace/apple2e/Apple2e.java +++ b/src/main/java/jace/apple2e/Apple2e.java @@ -170,8 +170,8 @@ public class Apple2e extends Computer { } private void insertCard(Class type, int slot) throws NoSuchMethodException, IllegalArgumentException, InvocationTargetException { - if (getMemory().getCard(slot) != null) { - if (getMemory().getCard(slot).getClass().equals(type)) { + if (getMemory().getCard(slot).isPresent()) { + if (getMemory().getCard(slot).get().getClass().equals(type)) { return; } getMemory().removeCard(slot);