Additional null checks.
This commit is contained in:
parent
b43caf0477
commit
d006bc6707
1 changed files with 7 additions and 4 deletions
|
|
@ -391,11 +391,14 @@ public class AlbumServlet
|
||||||
if (n++ > 0) out.println(",");
|
if (n++ > 0) out.println(",");
|
||||||
out.println(" {");
|
out.println(" {");
|
||||||
out.println(" \"name\": " + jsStr(e.getName()) + ",");
|
out.println(" \"name\": " + jsStr(e.getName()) + ",");
|
||||||
out.println(" \"path\": " + jsStr(mapper.map(e.getThumbnail().getPath())) + ",");
|
|
||||||
out.println(" \"type\": " + jsStr(e.getType()) + ",");
|
out.println(" \"type\": " + jsStr(e.getType()) + ",");
|
||||||
out.println(" \"thumbtype\": " + jsStr(e.getThumbnail().getType()) + ",");
|
Thumbnail thumb = e.getThumbnail();
|
||||||
out.println(" \"width\": " + e.getThumbnail().getSize().getWidth() + ",");
|
if (thumb != null) {
|
||||||
out.println(" \"height\": " + e.getThumbnail().getSize().getHeight() + ",");
|
out.println(" \"path\": " + jsStr(mapper.map(thumb.getPath())) + ",");
|
||||||
|
out.println(" \"thumbtype\": " + jsStr(thumb.getType()) + ",");
|
||||||
|
out.println(" \"width\": " + thumb.getSize().getWidth() + ",");
|
||||||
|
out.println(" \"height\": " + thumb.getSize().getHeight() + ",");
|
||||||
|
}
|
||||||
out.println(" \"caption\": " + jsStr(e.getCaption()));
|
out.println(" \"caption\": " + jsStr(e.getCaption()));
|
||||||
out.print(" }");
|
out.print(" }");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue