changeset 220:93cb2dd1d0e0

8132466: PWM: unexpected NPE Summary: Added null check Reviewed-by: snazarki Contributed-by: olga.milovskaya@oracle.com
author snazarki
date Tue, 28 Jul 2015 18:45:46 +0300
parents d2a298618ab8
children 2146ba8bc43a
files src/share/classes/jdk/dio/pwm/PWMChannelConfig.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/dio/pwm/PWMChannelConfig.java	Tue Jul 28 18:08:58 2015 +0300
+++ b/src/share/classes/jdk/dio/pwm/PWMChannelConfig.java	Tue Jul 28 18:45:46 2015 +0300
@@ -194,7 +194,9 @@
          * {@code null} and is not configured for output.
          */
         public Builder setOutputConfig(GPIOPinConfig outputConfig) {
-            checkOutput(outputConfig);
+            if (outputConfig != null) {
+                checkOutput(outputConfig);
+            }
             instance.outputConfig = outputConfig;
             return this;
         }