From 997f18f65882a2df2f14c9f61536403ad98af128 Mon Sep 17 00:00:00 2001 From: reger Date: Tue, 1 Dec 2015 00:06:50 +0100 Subject: [PATCH] prevent exception on repeated ViewImage with same urlLicense --- htroot/ViewImage.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htroot/ViewImage.java b/htroot/ViewImage.java index d6838dc8b..c93473030 100644 --- a/htroot/ViewImage.java +++ b/htroot/ViewImage.java @@ -107,8 +107,13 @@ public class ViewImage { } if ((url == null) && (urlLicense.length() > 0)) { - urlString = URLLicense.releaseLicense(urlLicense); - url = new DigestURL(urlString); + urlString = URLLicense.releaseLicense(urlLicense); + if (urlString != null) { + url = new DigestURL(urlString); + } else { // license is gone (e.g. released/remove in prev calls) + ConcurrentLog.fine("ViewImage", "image urlLicense not found key=" + urlLicense); + return null; //TODO: maybe favicon accessed again, check iconcache + } } // get the image as stream