Pattern 13 is not running properly

package patterns;

import java.util.Scanner;

public class pattern6 {

public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	
	int row = (2 * n) - 1;
	int nst = 1;

	int i = 1;

	while (i <= row) {
		int k = 1;
		while (k <= nst) {
			System.out.print("*");
			k++;
		}
		System.out.println();
		if (nst <= (row / 2)) {
			nst++;
		} else {
			nst--;
		}
		i++;

	}

}

}

@mishikasrvastava,
https://ide.codingblocks.com/s/287960 corrected code.

Instead of:

if (nst <= (row / 2)) {

you had to do:

			if (i <= (row / 2)) {