- String[] parts = inputString.split("\\.");
- for (String part: parts) {
- ans <<= 8;
- ans |= Integer.parseInt(part);
+ if (inputString != null) {
+ String[] parts = inputString.split("\\.");
+ for (String part: parts) {
+ ans <<= 8;
+ ans |= Integer.parseInt(part);
+ }