Skip to content

NullPointerException due to null value stored in locations list

When running MDroid+ with GNUCash application, a NullPointerException is shown in the console and the generation of mutants stops.

Screenshot_20180410_003407

When looking into the code I realize that in ClosingNullCursorLocator.java between lines 44 and 46 the locator stores a null value in the locations list. However, that list is used in MutationLocationListBuilder.java at line 29 when trying to setType to the location.

Nevertheless, after searching in the source code there are 6 locators that set null values into the locations list. Therefore, the solution is to modify MutationLocationListBuilder.java method and add the if clause that checks if the location retrieved from the list is null and avoid calling the setType method.