This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Description
The following code throws a NullPointerException if an empty string ("") is used for username. The code works fine if a non-empty string is used. Tested on Windows 10 using OpenJDK 15 only.
Expected behavior would be eighter:
a) Don't accept "" in StoredCredential constructor
b) (preferred) Don't throw an exception during store.get() to enable storing passwords/secrets without a username.
com.microsoft.credentialstorage.SecretStore<StoredCredential> store = StorageProvider.getCredentialStorage(true, StorageProvider.SecureOption.REQUIRED);
String username = "";
store.add("dummy", new StoredCredential(username, "xxx".toCharArray()));
try {
store.get("dummy");
} catch (Exception e) {
e.printStackTrace();
}