Project

General

Profile

« Previous | Next » 

Revision fefb4739

Added by Leszek Koltunski over 1 year ago

defensive programming

View differences:

src/main/java/org/distorted/external/RubikScores.java
452 452

  
453 453
          if( ordinal>=0 && ordinal<numObjects )
454 454
            {
455
            time = Integer.parseInt(timeStr);
456
            subm = Integer.parseInt(submStr);
455
            try
456
              {
457
              time = Integer.parseInt(timeStr);
458
              subm = Integer.parseInt(submStr);
459
              }
460
            catch(NumberFormatException ex)
461
              {
462
              subm = 1;
463
              time = 0;
464
              errorStr += ("error1: timeStr="+timeStr+" submStr: "+submStr+"\n");
465
              thereWasError= true;
466
              }
457 467

  
458 468
            if( subm>=0 && subm<=1 )
459 469
              {

Also available in: Unified diff