Skip to content

Commit

Permalink
* Fix NullPointerException in Parser on unexpected forms of func…
Browse files Browse the repository at this point in the history
…tion pointers (issue #70)
  • Loading branch information
saudet committed Feb 15, 2016
1 parent 6e982f7 commit eabafa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Fix `NullPointerException` in `Parser` on unexpected forms of function pointers ([issue #70](https://github.com/bytedeco/javacpp/issues/70))
* Make sure `Generator` produces calls to `sizeof()` and `offsetof()` for all `Pointer` classes with allocators
* Let `Parser` use adapters in the case of `FunctionPointer` as well ([issue bytedeco/javacpp-presets#145](https://github.com/bytedeco/javacpp-presets/issues/145))
* Prepend "javacpp." to all properties associated with Maven in `BuildMojo` to avoid name clashes
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,10 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole
}
info = infoMap.getFirst(cppType += ")");

String functionType = Character.toUpperCase(originalName.charAt(0)) + originalName.substring(1);
String functionType = null;
if (originalName != null) {
functionType = Character.toUpperCase(originalName.charAt(0)) + originalName.substring(1);
}
if (info != null && info.pointerTypes.length > 0) {
functionType = info.pointerTypes[0];
} else if (typedef) {
Expand Down

0 comments on commit eabafa4

Please sign in to comment.