diff --git a/src/main/java/com/hierynomus/spnego/RawToken.java b/src/main/java/com/hierynomus/spnego/RawToken.java index 5592e792..352a147c 100644 --- a/src/main/java/com/hierynomus/spnego/RawToken.java +++ b/src/main/java/com/hierynomus/spnego/RawToken.java @@ -15,8 +15,6 @@ */ package com.hierynomus.spnego; -import java.io.IOException; - import com.hierynomus.asn1.types.constructed.ASN1TaggedObject; import com.hierynomus.protocol.commons.buffer.Buffer; @@ -35,6 +33,8 @@ protected void parseTagged(ASN1TaggedObject asn1TaggedObject) throws SpnegoExcep @Override public void write(Buffer buffer) throws SpnegoException { - buffer.putRawBytes(rawToken); + if (rawToken != null) { + buffer.putRawBytes(rawToken); + } } }