From 3231ac3f375bef7f3f6a7b3339e3d865d2710cae Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Sun, 15 Mar 2015 00:28:31 -0500 Subject: [PATCH] Fixed bug caused by switch to Optional usage, caused disk changes to not work properly --- src/main/java/jace/apple2e/Apple2e.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);