Skip to content

Commit 1741a47

Browse files
authored
FBX-60 fix ArgumentNullException when opening export window on linux (#562)
* fix ArgumentNullException on Linux when OnGUI called before export set is set * update changelog and bump version * reduce min coverage
1 parent 287ff7a commit 1741a47

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.yamato/upm-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ platforms:
1414
image: package-ci/mac:stable
1515
flavor: b1.medium
1616
coverage:
17-
minPercent: 57.6
17+
minPercent: 57.5
1818
---
1919
pack:
2020
name: Pack

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes in Fbx Exporter
22

3+
## [4.0.0-pre.4] - 2021-01-26
4+
### Fixed
5+
- Fix ArgumentNullException on Linux when opening Export Options window.
6+
37
## [4.0.0-pre.3] - 2021-01-13
48
### Changed
59
- Added missing release date information to changelog.

com.unity.formats.fbx/Editor/ExportModelEditorWindow.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,18 @@ public void OnPresetSelectionChanged()
276276
protected bool SelectionContainsPrefabInstanceWithAddedObjects()
277277
{
278278
var exportSet = GetToExport();
279+
// FBX-60 (fogbug 1307749):
280+
// On Linux OnGUI() sometimes gets called a few times before
281+
// the export set is set and window.show() is called.
282+
// This leads to this function being called from OnGUI() with a
283+
// null or empty export set, and an ArgumentNullException when
284+
// creating the stack.
285+
// Check that the set exists and has values before creating the stack.
286+
if (exportSet == null || exportSet.Length <= 0)
287+
{
288+
return false;
289+
}
290+
279291
Stack<Object> stack = new Stack<Object>(exportSet);
280292
while (stack.Count > 0)
281293
{

com.unity.formats.fbx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.formats.fbx",
33
"displayName": "FBX Exporter",
4-
"version": "4.0.0-pre.3",
4+
"version": "4.0.0-pre.4",
55
"dependencies": {
66
"com.unity.timeline": "1.0.0",
77
"com.autodesk.fbx": "4.0.0-pre.2"

0 commit comments

Comments
 (0)