changeset 2761:008bdab5b9fb

Ensemble8: Fix for RT-28796 NPE in Ensemble8
author Alexander Kouznetsov
date Tue, 05 Mar 2013 10:07:54 -0800
parents 4620dab2c1ac
children 637a0d67106f 14df3baed0f8 bc78e8b64377
files apps/samples/Ensemble8/src/app/ensemble/SampleInfo.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/Ensemble8/src/app/ensemble/SampleInfo.java	Tue Mar 05 08:25:40 2013 -0800
+++ b/apps/samples/Ensemble8/src/app/ensemble/SampleInfo.java	Tue Mar 05 10:07:54 2013 -0800
@@ -341,9 +341,12 @@
         String getName();
     }
     
-    private static Map<String, Image> imageCache = new WeakHashMap<>();
+    private static Map<String, Image> imageCache;
     
     private static Image getImage(String url) {
+        if (imageCache == null) {
+            imageCache = new WeakHashMap<>();
+        }
         Image image = imageCache.get(url);
         if (image == null) {
             image = new Image(url);