Skip to content

Commit

Permalink
60 recipe search does a null exception when one cell is empty (#62)
Browse files Browse the repository at this point in the history
* fix: Fix possible null exeption

---------

Co-authored-by: Romuald Rousseau <[email protected]>
  • Loading branch information
RomualdRousseau and Romuald Rousseau authored Nov 28, 2024
1 parent 3c09676 commit 88e8433
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
import com.github.romualdrousseau.archery.event.TableGraphBuiltEvent;
import com.github.romualdrousseau.archery.event.TableReadyEvent;
import com.github.romualdrousseau.archery.intelli.IntelliTable;

import com.github.romualdrousseau.archery.TransformableSheet;
import com.github.romualdrousseau.archery.commons.collections.CollectionUtils;
import com.github.romualdrousseau.archery.commons.strings.StringUtils;

public class BaseSheet implements Sheet {

Expand Down Expand Up @@ -258,7 +260,7 @@ public List<Integer> searchCell(final String regex, final int offset, final int
for(int i = 0; i < length; i++) {
for (int j = 0; j < this.getLastColumnNum(offset + i); j++) {
final var cell = this.getCellDataAt(j, offset + i);
if (cell != null && cell.matches(regex)) {
if (!StringUtils.isFastBlank(cell) && cell.matches(regex)) {
if (++n == nth) {
return List.of(j, offset + i);
}
Expand Down

0 comments on commit 88e8433

Please sign in to comment.