commit c826d83b09e82e72e29eaecf09b541e9a5274e36
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon May 2 10:42:34 2022 +0200

    Fix for a crasher

diff --git a/src/main/java/org/distorted/config/ConfigScreenPane.java b/src/main/java/org/distorted/config/ConfigScreenPane.java
index dc7ac784..91d4f576 100644
--- a/src/main/java/org/distorted/config/ConfigScreenPane.java
+++ b/src/main/java/org/distorted/config/ConfigScreenPane.java
@@ -70,43 +70,46 @@ public class ConfigScreenPane
 
   void updatePane(ConfigActivity act, int objectOrdinal)
     {
-    JsonReader reader = JsonReader.getInstance();
+    RubikObject object = RubikObjectList.getObject(objectOrdinal);
 
-    mObjectOrdinal = objectOrdinal;
+    if( object!=null )
+      {
+      InputStream stream = object.getObjectStream(act);
 
-    RubikObject object = RubikObjectList.getObject(objectOrdinal);
-    InputStream stream = object.getObjectStream(act);
-    reader.parseJsonFileMetadata(stream);
+      mObjectOrdinal = objectOrdinal;
+      JsonReader reader = JsonReader.getInstance();
+      reader.parseJsonFileMetadata(stream);
 
-    String name = reader.getObjectName();
-    String author = reader.getInventor();
-    int year = reader.getYearOfInvention();
-    String both = year>0 ? author+" "+year : author;
+      String name = reader.getObjectName();
+      String author = reader.getInventor();
+      int year = reader.getYearOfInvention();
+      String both = year>0 ? author+" "+year : author;
 
-    LinearLayout layout = act.findViewById(R.id.configLayout);
-    TextView view = layout.findViewById(R.id.configDetailsName2);
-    view.setText(name);
-    view = layout.findViewById(R.id.configDetailsAuthor2);
-    view.setText(both);
+      LinearLayout layout = act.findViewById(R.id.configLayout);
+      TextView view = layout.findViewById(R.id.configDetailsName2);
+      view.setText(name);
+      view = layout.findViewById(R.id.configDetailsAuthor2);
+      view.setText(both);
 
-    int difficulty = reader.getComplexity();
+      int difficulty = reader.getComplexity();
 
-    if( difficulty<0          ) difficulty=0;
-    if( difficulty>NUM_IMAGES ) difficulty=NUM_IMAGES;
+      if( difficulty<0          ) difficulty=0;
+      if( difficulty>NUM_IMAGES ) difficulty=NUM_IMAGES;
 
-    for(int i=0; i<NUM_IMAGES; i++)
-      {
-      ImageView image = layout.findViewById(IMAGES[i]);
-      image.setImageResource( i==difficulty ? R.drawable.ui_difficulty_checked : R.drawable.ui_difficulty_unchecked );
-      }
+      for(int i=0; i<NUM_IMAGES; i++)
+        {
+        ImageView image = layout.findViewById(IMAGES[i]);
+        image.setImageResource( i==difficulty ? R.drawable.ui_difficulty_checked : R.drawable.ui_difficulty_unchecked );
+        }
 
-    int meshState = object.getMeshState();
-    int id = meshState==MESH_NICE ? R.id.meshNice : R.id.meshSimple;
-    RadioButton button = act.findViewById(id);
+      int meshState = object.getMeshState();
+      int id = meshState==MESH_NICE ? R.id.meshNice : R.id.meshSimple;
+      RadioButton button = act.findViewById(id);
 
-    mProgramatic = true;
-    button.setChecked(true);
-    mProgramatic = false;
+      mProgramatic = true;
+      button.setChecked(true);
+      mProgramatic = false;
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
