diff options
author | Erik Gilling <konkers@android.com> | 2011-03-21 16:33:09 -0700 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2011-03-21 16:33:57 -0700 |
commit | ffc2bc09112691b1fdf5cc4a9667119f77deafef (patch) | |
tree | 5a2e19e823f9e2418cd446105ad4ccee56b55907 | |
parent | d601ddda77dd106cf1ad546e561e41a2c7c0d20f (diff) | |
download | demokit-ffc2bc09112691b1fdf5cc4a9667119f77deafef.tar.gz |
Check if outputstream is open before writing data to it.
Change-Id: I618a1089b01b19ae4a75645ffef72e68405106a7
-rw-r--r-- | demokit/app/src/com/google/DemoKit/DemoKitActivity.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/demokit/app/src/com/google/DemoKit/DemoKitActivity.java b/demokit/app/src/com/google/DemoKit/DemoKitActivity.java index fb0473c..b9f3636 100644 --- a/demokit/app/src/com/google/DemoKit/DemoKitActivity.java +++ b/demokit/app/src/com/google/DemoKit/DemoKitActivity.java @@ -401,6 +401,9 @@ public class DemoKitActivity extends Activity implements Runnable, SeekBar.OnSee }; public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + if (mOutputStream == null) + return; + byte[] buffer = new byte[3]; if (progress > 255) progress = 255; @@ -451,6 +454,9 @@ public class DemoKitActivity extends Activity implements Runnable, SeekBar.OnSee } public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (mOutputStream == null) + return; + byte[] buffer = new byte[3]; buffer[0] = 0x3; buffer[1] = -1; |