Skip to content

Commit

Permalink
Merge branch 'hotfix/129_website'
Browse files Browse the repository at this point in the history
  • Loading branch information
WFMJ7631 authored and WFMJ7631 committed Jun 6, 2017
2 parents 91b9777 + 933884b commit e9fa7b4
Show file tree
Hide file tree
Showing 4 changed files with 2,035 additions and 2,027 deletions.
3 changes: 3 additions & 0 deletions src/fi/iki/elonen/NanoHTTPD.java
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,14 @@ public void execute() throws IOException {
Response resp = newFixedLengthResponse(Response.Status.INTERNAL_ERROR, NanoHTTPD.MIME_PLAINTEXT, "SERVER INTERNAL ERROR: IOException: " + ioe.getMessage());
resp.send(this.outputStream);
safeClose(this.outputStream);
ioe.printStackTrace();
} catch (ResponseException re) {
Response resp = newFixedLengthResponse(re.getStatus(), NanoHTTPD.MIME_PLAINTEXT, re.getMessage());
resp.send(this.outputStream);
safeClose(this.outputStream);
re.printStackTrace();
} finally {

safeClose(r);
this.tempFileManager.clear();
}
Expand Down
15 changes: 9 additions & 6 deletions src/tourma/utils/web/WebPicture.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ public class WebPicture {

public static String getPictureAsHTML(ImageIcon pic, int width, int heigth) {

BufferedImage bi = new BufferedImage(pic.getIconWidth(), pic.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics g = bi.createGraphics();
pic.paintIcon(null, g, 0, 0);
g.dispose();
return getPictureAsHTML(bi, width, heigth, Tournament.getTournament().getParams().isUseImage());

if (pic != null) {
BufferedImage bi = new BufferedImage(pic.getIconWidth(), pic.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics g = bi.createGraphics();
pic.paintIcon(null, g, 0, 0);
g.dispose();
return getPictureAsHTML(bi, width, heigth, Tournament.getTournament().getParams().isUseImage());
} else {
return "";
}

}

Expand Down
Loading

0 comments on commit e9fa7b4

Please sign in to comment.