Update Cache.java

Updated to avoid NullPointer in getOutgoingMessage()