From 7ca3432cacd0ea3bce8501ef077aa56bd24bea60 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 11 Aug 2011 17:31:29 +0200 Subject: [PATCH] allow passing null to PyType.union() --- python/src/com/jetbrains/python/psi/types/PyUnionType.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/src/com/jetbrains/python/psi/types/PyUnionType.java b/python/src/com/jetbrains/python/psi/types/PyUnionType.java index 31299c412b6c..f20035b5f384 100644 --- a/python/src/com/jetbrains/python/psi/types/PyUnionType.java +++ b/python/src/com/jetbrains/python/psi/types/PyUnionType.java @@ -73,6 +73,12 @@ public class PyUnionType implements PyType { @Nullable public static PyType union(PyType type1, PyType type2) { + if (type2 == null) { + return type1; + } + if (type1 == null) { + return type2; + } if (type1 instanceof PyTupleType && type2 instanceof PyTupleType) { final PyTupleType tupleType1 = (PyTupleType)type1; final PyTupleType tupleType2 = (PyTupleType)type2;