Skip to content

Commit 258be9e

Browse files
committed
Adding a null check to StopSpeaking
1 parent 1dccc65 commit 258be9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/HoloToolkit/Utilities/Scripts/TextToSpeechManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public void SpeakText(string text)
387387
/// </summary>
388388
public void StopSpeaking()
389389
{
390-
if (audioSource.isPlaying)
390+
if (audioSource != null && audioSource.isPlaying)
391391
{
392392
audioSource.Stop();
393393
}

0 commit comments

Comments
 (0)