Skip to content

Commit

Permalink
NPE fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Jul 1, 2015
1 parent 8f81338 commit dff31ea
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -557,10 +557,12 @@ public synchronized HttpExchange setCookie(String name, String value, String...
} }


@Override @Override
public synchronized HttpExchange setContentType(MediaType MediaType) { public synchronized HttpExchange setContentType(MediaType mediaType) {
U.must(!hasContentType, "Content type was already set!"); U.must(!hasContentType, "Content type was already set!");


addHeader(HttpHeader.CONTENT_TYPE.getBytes(), MediaType.getBytes()); if (mediaType != null) {
addHeader(HttpHeader.CONTENT_TYPE.getBytes(), mediaType.getBytes());
}


// this must be at the end of this method, because state might get restarted // this must be at the end of this method, because state might get restarted
hasContentType = true; hasContentType = true;
Expand Down

0 comments on commit dff31ea

Please sign in to comment.