Changeset 1350 for trunk


Ignore:
Timestamp:
05/06/19 10:32:35 (5 years ago)
Author:
bln4
Message:

Gracefully deal with the possibility that the call to FrameIO.CreateFrameset in FrameIO.CreateNewProfile can return null by displaying a error messages and exiting the program.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameIO.java

    r1349 r1350  
    14711471        public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException  {
    14721472                Frame profile = CreateFrameset(username, PROFILE_PATH, true);
    1473                 FrameUtils.CreateDefaultProfile(username, profile, initialSettings, toNotifyOnSet);
     1473                if (profile != null) {
     1474                        FrameUtils.CreateDefaultProfile(username, profile, initialSettings, toNotifyOnSet);
     1475                } else {
     1476                        System.err.println("An error occured while attempting to create the profile named: " + username);
     1477                        System.err.println("Unable to proceed.");
     1478                        System.exit(1);
     1479                }
    14741480                return profile;
    14751481        }
Note: See TracChangeset for help on using the changeset viewer.