8129499: Structure of java/rmi/activation/rmidViaInheritedChannel tests masks exception

Check for rmid == null before dereferencing the variable.

Reviewed-by: rriggs, chegar
This commit is contained in:
Brian Burkhalter 2015-06-22 13:30:21 -07:00
parent c1108923f4
commit c0b2c2b0e6
2 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -126,7 +126,9 @@ public class InheritedChannelNotServerSocket {
if (obj != null) {
UnicastRemoteObject.unexportObject(obj, true);
}
rmid.cleanup();
if (rmid != null) {
rmid.cleanup();
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -125,7 +125,9 @@ public class RmidViaInheritedChannel implements Callback {
if (obj != null) {
UnicastRemoteObject.unexportObject(obj, true);
}
rmid.cleanup();
if (rmid != null) {
rmid.cleanup();
}
}
}