Skip to content
Snippets Groups Projects
Commit 648022e1 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

take care when setting descriptor to avoid NPE

parent c301ca53
No related branches found
No related tags found
No related merge requests found
......@@ -818,10 +818,11 @@ public class DisThreadedNetworkInterface
*/
public void setDescriptor(String newDescriptor)
{
this.descriptor = newDescriptor;
TRACE_PREFIX = "[" + (DisThreadedNetworkInterface.class.getSimpleName() + " " + descriptor).trim() + "] ";
if (newDescriptor != null)
this.descriptor = newDescriptor.trim();
TRACE_PREFIX = "[" + DisThreadedNetworkInterface.class.getSimpleName() + " " + descriptor + "] ";
}
/** Self test to check basic operation, invoked by main() */
private void selfTest()
{
System.out.println(TRACE_PREFIX + "main() self test initialized...");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment