diff --git a/src/org/zaproxy/zap/authentication/ManualAuthenticationMethodType.java b/src/org/zaproxy/zap/authentication/ManualAuthenticationMethodType.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/authentication/ManualAuthenticationMethodType.java
+++ b/src/org/zaproxy/zap/authentication/ManualAuthenticationMethodType.java
@@ -200,6 +200,9 @@ public class ManualAuthenticationMethodType extends AuthenticationMethodType {
 
 		@Override
 		public String encode(String parentStringSeparator) {
+			if (selectedSession == null) {
+				return "";
+			}
 			return Base64.encodeBase64String(selectedSession.getName().getBytes());
 		}
Fix NPE when saving manual authentication data

Change ManualAuthenticationMethodType to skip session's encoding if
none was set, preventing the NullPointerException.

Fix #<I> - Error whilst using Api - ERROR ExtensionUserManagement -
Unable to persist Users