From 353ddcbd9f41b6e3953e055a73de09e4c0449522 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Mon, 6 May 2013 17:34:59 +0400 Subject: [PATCH] Fixed NPE at DocumentationBuilderKit.combUp (PY-9731) --- .../python/documentation/PyTypeModelBuilder.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java b/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java index 6ed09d702ffc..099de9bddbc2 100644 --- a/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java +++ b/python/src/com/jetbrains/python/documentation/PyTypeModelBuilder.java @@ -108,11 +108,11 @@ public class PyTypeModelBuilder { } static class ParamType extends TypeModel { - private final String name; - private final TypeModel type; + @Nullable private final String name; + @Nullable private final TypeModel type; - private ParamType(String name, @Nullable TypeModel type) { + private ParamType(@Nullable String name, @Nullable TypeModel type) { this.name = name; this.type = type; } @@ -330,9 +330,13 @@ public class PyTypeModelBuilder { add("..."); return; } - add(param.name); + if (param.name != null) { + add(param.name); + } if (param.type != null) { - add(": "); + if (param.name != null) { + add(": "); + } param.type.accept(this); } myDepth--;