Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

小bug~ #14

Closed
NaClYen opened this issue Apr 21, 2017 · 1 comment
Closed

小bug~ #14

NaClYen opened this issue Apr 21, 2017 · 1 comment

Comments

@NaClYen
Copy link

NaClYen commented Apr 21, 2017

今天爬文爬到這工具, 不小心手殘就按出問題~
觸發方式: 在 AssetBundleBuildPanel UI 的清單項目上按下 'Select', 接著選擇 '取消' 關閉視窗, 接著 UI 就會不斷刷出這個 Exception

NullReferenceException: Object reference not set to an instance of an object
...(略)
Tangzx.ABSystem.AssetBundleBuildPanel.OnListElementGUI (Rect rect, Int32 index, Boolean isactive, Boolean isfocused) (at Assets/ABSystem/Editor/AssetBundleBuildPanel.cs:79)
...(略)

原因應該是
filter.path = GUI.TextField(r, filter.path);
第一個參數不能為 null 造成的.

我修正的方式是把84行附近的:
if (GUI.Button(r, "Select")) { filter.path = SelectFolder(); }
增加檢查來避免給 null.
if (GUI.Button(r, "Select")) { var path = SelectFolder(); if (path != null) filter.path = path; }

@tangzx
Copy link
Owner

tangzx commented Apr 21, 2017

是的,已按照你的方式修正~

@tangzx tangzx closed this as completed Apr 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants