]> source.dussan.org Git - poi.git/commitdiff
Bug28755: CellReference will throws IllegalArgumentException when an illegal cell...
authorJason Height <jheight@apache.org>
Mon, 28 Aug 2006 03:54:04 +0000 (03:54 +0000)
committerJason Height <jheight@apache.org>
Mon, 28 Aug 2006 03:54:04 +0000 (03:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437522 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/util/CellReference.java

index 623f8175a11ddc6a6c7061b12ab1b4964fd556a5..0b29415d9bf07c081fe2b80458b8c7098a995245 100644 (file)
@@ -34,13 +34,17 @@ public class CellReference {
     public CellReference(String cellRef) {
         String[] parts = separateRefParts(cellRef);
         sheetName = parts[0];
-        String ref = parts[1];
+        String ref = parts[1]; 
+        if ((ref == null)||("".equals(ref)))
+               throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
         if (ref.charAt(0) == '$') {
             colAbs=true;
             ref=ref.substring(1);
         }
         col = convertColStringToNum(ref);
         ref=parts[2];
+        if ((ref == null)||("".equals(ref)))
+               throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
         if (ref.charAt(0) == '$') {
             rowAbs=true;
             ref=ref.substring(1);