Ver código fonte

Ajout gestion generation de LispElement null

Arthur Brandao 6 anos atrás
pai
commit
9cce03617c
1 arquivos alterados com 6 adições e 3 exclusões
  1. 6 3
      src/migl/lisp/LispElement.java

+ 6 - 3
src/migl/lisp/LispElement.java

@@ -242,10 +242,13 @@ public class LispElement {
 	 * @return
 	 */
 	public static LispElement generate(Object elt) {
-		if(elt.getClass() == LispElement.class) {
-			return (LispElement) elt;
+		if(elt == null) {
+			return new LispElement(null);
 		}
-		if(elt.getClass() == Integer.class) {
+		else if(elt.getClass() == LispElement.class) {
+			return (LispElement) elt;
+		} 
+		else if(elt.getClass() == Integer.class) {
 			elt = BigInteger.valueOf((Integer) elt);
 		}
 		else if(elt.getClass() == Boolean.class) {