commit 90288e233b638a37cd47cddd154b3593770747e0
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Feb 2 16:49:14 2022 +0100

    Make sure we always display some icon in the Popup dialog, even if we fail to download one.

diff --git a/src/main/java/org/distorted/objects/RubikObject.java b/src/main/java/org/distorted/objects/RubikObject.java
index 79cf6e53..4492aab8 100644
--- a/src/main/java/org/distorted/objects/RubikObject.java
+++ b/src/main/java/org/distorted/objects/RubikObject.java
@@ -32,6 +32,7 @@ import android.widget.ImageView;
 import org.distorted.dmesh.ObjectMesh;
 import org.distorted.external.RubikFiles;
 import org.distorted.jsons.ObjectJson;
+import org.distorted.main.R;
 import org.distorted.objectlib.json.JsonWriter;
 import org.distorted.objectlib.main.ObjectType;
 import org.distorted.patterns.RubikPatternList;
@@ -99,9 +100,19 @@ public class RubikObject
     mExtrasOrdinal = -1;
 
     mMeshID        =  0;
-    mIconID        = -1;
     mJsonID        = -1;
     mExtrasID      = -1;
+
+    if( object.icon )  // icon successfully downloaded
+      {
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", object.shortName+" : icon downloaded");
+      mIconID = -1;  // i.e. look for the icon in local per-app storage
+      }
+    else
+      {
+      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", object.shortName+" : icon failed to download");
+      mIconID = R.drawable.unknown_icon;
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
