فهرست منبع

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() {
 	public function pop() {
 		untyped {
 		untyped {
+			if( this.length == 0 )
+				return null;
 			this.length -= 1;
 			this.length -= 1;
 			var x = this.__a[this.length];
 			var x = this.__a[this.length];
 			this.__a[this.length] = null;
 			this.__a[this.length] = null;