Skip to content

Commit 4a3587a

Browse files
Stephen HodgsonStephen Hodgson
authored andcommitted
UAudioManager added check for null or empty string before searching eventDictionary.
1 parent 404ba99 commit 4a3587a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Assets/HoloToolkit/SpatialSound/Scripts/UAudioManager/UAudioManager.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,17 @@ private void PlayEvent(string eventName,
132132
emitter = gameObject;
133133
}
134134

135+
if (string.IsNullOrEmpty(eventName))
136+
{
137+
Debug.LogWarning("Audio Event string is null or empty!");
138+
return;
139+
}
140+
135141
AudioEvent currentEvent;
136142

137143
if (!eventsDictionary.TryGetValue(eventName, out currentEvent))
138144
{
139-
Debug.LogFormat( "Could not find event \"{0}\"", eventName);
145+
Debug.LogFormat("Could not find event \"{0}\"", eventName);
140146
return;
141147
}
142148

0 commit comments

Comments
 (0)