浏览代码

fixed bug in pop.

Nicolas Cannasse 19 年之前
父节点
当前提交
ee2f696d98
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      std/neko/NekoArray__.hx

+ 2 - 0
std/neko/NekoArray__.hx

@@ -117,6 +117,8 @@ class NekoArray__<T> implements Array<T> {
 
 	public function pop() {
 		untyped {
+			if( this.length == 0 )
+				return null;
 			this.length -= 1;
 			var x = this.__a[this.length];
 			this.__a[this.length] = null;