Преглед на файлове

Ajout gestion generation de LispElement null

Arthur Brandao преди 6 години
родител
ревизия
9cce03617c
променени са 1 файла, в които са добавени 6 реда и са изтрити 3 реда
  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) {