#vulnerable code 
                                @Test
	public void TestFullConfig(){
        String expectedConfigDirectory = ".";
        ServerPaths serverPaths = mock(ServerPaths.class);
        when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

		SlackNotificationMainSettings whms = new SlackNotificationMainSettings(server, serverPaths);
		whms.register();
		whms.readFrom(getFullConfigElement());
		String proxy = whms.getProxyForUrl("http://something.somecompany.com");
		SlackNotificationProxyConfig whpc = whms.getProxyConfigForUrl("http://something.somecompany.com");
		assertTrue(proxy.equals(this.proxyHost));
		assertTrue(whpc.getProxyHost().equals(this.proxyHost ));
		assertTrue(whpc.getProxyPort().equals(this.proxyPort));
        assertTrue(whms.getDefaultChannel().equals(this.defaultChannel));
        assertTrue(whms.getTeamName().equals(this.teamName));
        assertTrue(whms.getToken().equals(this.token));
        assertTrue(whms.getIconUrl().equals(this.iconUrl));
        assertTrue(whms.getBotName().equals(this.botName));
        assertTrue(whms.getShowBuildAgent());
        assertTrue(whms.getShowElapsedBuildTime());
        assertFalse(whms.getShowCommits());
        assertEquals(15, whms.getMaxCommitsToDisplay());
        
        Credentials credentials = whpc.getCreds();
        
		assertEquals("some-username", credentials.getUserPrincipal().getName());
		assertEquals("some-password", credentials.getPassword());
	} 
                            #location 13 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
	public void TestFullConfig(){
        String expectedConfigDirectory = ".";
        ServerPaths serverPaths = mock(ServerPaths.class);
        when(serverPaths.getConfigDir()).thenReturn(expectedConfigDirectory);

		SlackNotificationMainSettings whms = new SlackNotificationMainSettings(server, serverPaths);
		whms.register();
		whms.readFrom(getFullConfigElement());
		String proxy = whms.getProxy();
		SlackNotificationProxyConfig whpc = whms.getProxyConfig();
		assertTrue(proxy.equals(this.proxyHost));
		assertTrue(whpc.getProxyHost().equals(this.proxyHost ));
		assertTrue(whpc.getProxyPort().equals(this.proxyPort));
        assertTrue(whms.getDefaultChannel().equals(this.defaultChannel));
        assertTrue(whms.getTeamName().equals(this.teamName));
        assertTrue(whms.getToken().equals(this.token));
        assertTrue(whms.getIconUrl().equals(this.iconUrl));
        assertTrue(whms.getBotName().equals(this.botName));
        assertTrue(whms.getShowBuildAgent());
        assertTrue(whms.getShowElapsedBuildTime());
        assertFalse(whms.getShowCommits());
        assertEquals(15, whms.getMaxCommitsToDisplay());
        
        Credentials credentials = whpc.getCreds();
        
		assertEquals("some-username", credentials.getUserPrincipal().getName());
		assertEquals("some-password", credentials.getPassword());
	}