Skip to content

Commit

Permalink
Handle NPE in getKeyfile()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilanji Rajamanickam committed Feb 4, 2020
1 parent 2f93dd2 commit b20c03f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.wepay.kafka.connect.bigquery.convert.SchemaConverter;

import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.config.types.Password;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.common.config.ConfigException;

Expand Down Expand Up @@ -410,7 +411,7 @@ protected static Map.Entry<String, String> parseMapping(String mapping, String n
* Returns the keyfile
*/
public String getKeyFile() {
return getPassword(KEYFILE_CONFIG).value();
return Optional.ofNullable(getPassword(KEYFILE_CONFIG)).map(Password::value).orElse(null);
}

/**
Expand Down

0 comments on commit b20c03f

Please sign in to comment.