Added null check to ObjectMessageProcessor
This commit is contained in:
parent
ea6d76757e
commit
e673c4e242
@ -38,7 +38,12 @@ public class ObjectMessageProcessor implements IMessageProcessor {
|
||||
public void process(Message message, WriteProxy writeProxy) {
|
||||
try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(message.sharedArray, message.offset + 4, message.length - 4))) {
|
||||
Object obj = in.readObject();
|
||||
System.out.println("Read object: " + obj.toString());
|
||||
if (obj == null) {
|
||||
System.out.println("received a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("Read object: " + obj);
|
||||
|
||||
// Process object
|
||||
processors.stream().filter(p -> p.getInputClass().isInstance(obj)).forEach((@SuppressWarnings("rawtypes") ObjectProcessor p) -> {
|
||||
|
Reference in New Issue
Block a user