Skip to content

Commit 729d2ad

Browse files
author
Matias Lavik
committed
Moved nullcheck
1 parent c530afd commit 729d2ad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Assets/Scripts/VolumeData/VolumeDataset.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,15 @@ private void CalculateValueBounds()
107107
minDataValue = float.MaxValue;
108108
maxDataValue = float.MinValue;
109109

110-
for (int i = 0; i < dimX * dimY * dimZ; i++)
110+
if (data != null)
111111
{
112-
if (data != null)
112+
for (int i = 0; i < dimX * dimY * dimZ; i++)
113113
{
114114
float val = data[i];
115115
minDataValue = Mathf.Min(minDataValue, val);
116116
maxDataValue = Mathf.Max(maxDataValue, val);
117117
}
118118
}
119-
120119
}
121120

122121
private Texture3D CreateTextureInternal()

0 commit comments

Comments
 (0)