#vulnerable code 
                             public static void main(String[] unparsedArgs) {
		
		ProgramMode programMode;
		CLIArguments args = null;
		
		if (unparsedArgs.length > 0) {
			
			try {
				args = CliFactory.parseArguments(CLIArguments.class, unparsedArgs);
			} catch (ArgumentValidationException e) {
				System.err.println(e.getMessage());
				System.exit(1);
			}
			
			if (!CLIArgumentsUtil.isValid(args)) {
				System.err.println(CLIArgumentsUtil.getErrorString(args));
				System.exit(1);
			}
			
			programMode = CLIArgumentsUtil.getProgramMode(args);
			
		} else {
		 
			System.out.println("No parameters, running graphical interface.\n"
					+ "If you want to use the command line, use the --help"
					+ " parameter for a list of available parameters.");
			programMode = ProgramMode.GUI;
			
		}
		
		switch (programMode) {
		
		case HELP:
			//parser.printHelp();
			System.out.println(
					CliFactory.createCli(CLIArguments.class).getHelpMessage()
					+ "\n\nFor more information, see " + GlobalValues.WIKI_URI);
			break;
			
		case VERSION:
			System.out.println("OSM2World " + VERSION_STRING);
			break;
		
		case GUI:
			try {
				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			} catch(Exception e) {
				System.out.println("Error setting native look and feel: " + e);
			}
			new ViewerFrame(new Data(), new MessageManager(), new RenderOptions())
				.setVisible(true);
			break;
			
		case CONVERT:
			try {
				Output.output(args);
			} catch (IOException e) {
				e.printStackTrace();
			}
			break;
			
		}
		
	} 
                            #location 56 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public static void main(String[] unparsedArgs) {
		
		ProgramMode programMode;
		CLIArguments args = null;
		
		/* parse command line arguments */
		
		if (unparsedArgs.length > 0) {
			
			try {
				args = CliFactory.parseArguments(CLIArguments.class, unparsedArgs);
			} catch (ArgumentValidationException e) {
				System.err.println(e.getMessage());
				System.exit(1);
			}
			
			if (!CLIArgumentsUtil.isValid(args)) {
				System.err.println(CLIArgumentsUtil.getErrorString(args));
				System.exit(1);
			}
			
			programMode = CLIArgumentsUtil.getProgramMode(args);
			
		} else {
		 
			System.out.println("No parameters, running graphical interface.\n"
					+ "If you want to use the command line, use the --help"
					+ " parameter for a list of available parameters.");
			programMode = ProgramMode.GUI;
			
		}
		
		/* load configuration file */

		Configuration config = new BaseConfiguration();
		
		if (args.isConfig()) {
			try {
				config = new PropertiesConfiguration(args.getConfig());
			} catch (ConfigurationException e) {
				System.err.println("could not read config, ignoring it: ");
				System.err.println(e);
			}
		}
		
		/* run selected mode */
		
		switch (programMode) {
		
		case HELP:
			//parser.printHelp();
			System.out.println(
					CliFactory.createCli(CLIArguments.class).getHelpMessage()
					+ "\n\nFor more information, see " + GlobalValues.WIKI_URI);
			break;
			
		case VERSION:
			System.out.println("OSM2World " + VERSION_STRING);
			break;
		
		case GUI:
			try {
				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			} catch(Exception e) {
				System.out.println("Error setting native look and feel: " + e);
			}
			new ViewerFrame(new Data(), new MessageManager(),
					new RenderOptions(), config).setVisible(true);
			break;
			
		case CONVERT:
			try {
				Output.output(config, args);
			} catch (IOException e) {
				e.printStackTrace();
			}
			break;
			
		}
		
	}