#vulnerable code 
                             public ArrayList<TextView> clickInRecyclerView(int itemIndex, int recyclerViewIndex, boolean longClick, int time) {
		View viewOnLine = null;
		final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();

		if(itemIndex < 0)
			itemIndex = 0;

		ArrayList<View> views = new ArrayList<View>();
		ViewGroup recyclerView = waiter.waitForRecyclerView(recyclerViewIndex);
		
		
		if(recyclerView == null){
			Assert.fail("RecycleView is null!");
		}
		else{
			viewOnLine = getViewOnRecyclerItemIndex((ViewGroup) recyclerView, itemIndex);
		}

		failIfIndexHigherThenChildCount(recyclerView, itemIndex, endTime);
		
		if(viewOnLine != null){
			views = viewFetcher.getViews(viewOnLine, true);
			views = RobotiumUtils.removeInvisibleViews(views);
			clickOnScreen(viewOnLine, longClick, time);
		}
		return RobotiumUtils.filterViews(TextView.class, views);
	} 
                            #location 19 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public ArrayList<TextView> clickInRecyclerView(int itemIndex, int recyclerViewIndex, boolean longClick, int time) {
		View viewOnLine = null;
		final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();

		if(itemIndex < 0)
			itemIndex = 0;

		ArrayList<View> views = new ArrayList<View>();
		ViewGroup recyclerView = viewFetcher.getRecyclerView(recyclerViewIndex);
		
		if(recyclerView == null){
			Assert.fail("RecyclerView is not found!");
		}
		else{
			failIfIndexHigherThenChildCount(recyclerView, itemIndex, endTime);
			viewOnLine = getViewOnRecyclerItemIndex((ViewGroup) recyclerView, recyclerViewIndex, itemIndex);
		}
		
		if(viewOnLine != null){
			views = viewFetcher.getViews(viewOnLine, true);
			views = RobotiumUtils.removeInvisibleViews(views);
			clickOnScreen(viewOnLine, longClick, time);
		}
		return RobotiumUtils.filterViews(TextView.class, views);
	}