Skip to content

Commit

Permalink
Handle no screenshottaker without throwing null reference exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sumner committed Apr 18, 2016
1 parent 02fe4fc commit bd2bf35
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void setDeleteIfSuccessful(boolean deleteIfSuccessful) {
@Override
protected void captureData() {
if (screenshotTaker == null) {
imageSize = new Dimension(0, 0);
return;
}

Expand Down Expand Up @@ -86,7 +87,11 @@ private File combine(String path1, String path2)

@Override
protected void addHTMLToContainer(final Element container) {
String href = this.imageName + "?version=" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
String href = "";

if (!imageName.isEmpty()) {
href = this.imageName + "?version=" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
}

// Add link to image
Element anchorImg = new Element("a");
Expand Down

0 comments on commit bd2bf35

Please sign in to comment.