Browse Source

Removing impossible null checks and other fixes.

GodKratos 15 years ago
parent
commit
43165ebbb6

+ 2 - 8
L2_GameServer/java/com/l2jserver/configurator/ConfigUserInterface.java

@@ -87,9 +87,6 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 	 */
 	 */
 	public static void main(String[] args)
 	public static void main(String[] args)
 	{
 	{
-		Locale locale = null;
-		
-		
 		try
 		try
         {
         {
 	        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 	        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@@ -98,11 +95,8 @@ public class ConfigUserInterface extends JFrame implements ActionListener
         {
         {
         	// couldn't care less
         	// couldn't care less
         }
         }
-		if (locale == null)
-			{
-				locale = Locale.getDefault();
-			}
-		final ResourceBundle bundle = ResourceBundle.getBundle("configurator.Configurator", locale, LanguageControl.INSTANCE);
+
+        final ResourceBundle bundle = ResourceBundle.getBundle("configurator.Configurator", Locale.getDefault(), LanguageControl.INSTANCE);
 
 
         SwingUtilities.invokeLater
         SwingUtilities.invokeLater
         (
         (

+ 4 - 9
L2_GameServer/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -1420,13 +1420,9 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 				{
 				{
 					if(sk.getTargetType() == SkillTargetType.TARGET_ONE)
 					if(sk.getTargetType() == SkillTargetType.TARGET_ONE)
 					{
 					{
-						
-						if(attackTarget != null && !attackTarget.isDead() && dist2<=srange)
+						if(!attackTarget.isDead() && dist2 <= srange)
 						{
 						{
-							
-
-							
-							if(dist2>range || attackTarget.isMoving())
+							if(dist2 > range || attackTarget.isMoving())
 							{
 							{
 								if (attackTarget.getFirstEffect(sk) == null)
 								if (attackTarget.getFirstEffect(sk) == null)
 								{
 								{
@@ -1438,7 +1434,6 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 							}
 							}
 						}
 						}
 
 
-
 						L2Character target = EffectTargetReconsider(sk,false);
 						L2Character target = EffectTargetReconsider(sk,false);
 						if (target != null)
 						if (target != null)
 						{
 						{
@@ -1971,7 +1966,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 				//If there is nearby Target with aggro, start going on random target that is attackable
 				//If there is nearby Target with aggro, start going on random target that is attackable
 				for (L2Character obj : _actor.getKnownList().getKnownCharactersInRadius(range))
 				for (L2Character obj : _actor.getKnownList().getKnownCharactersInRadius(range))
 				{
 				{
-					if(obj.isDead() || obj == null || !GeoData.getInstance().canSeeTarget(_actor,obj))
+					if(obj.isDead() || !GeoData.getInstance().canSeeTarget(_actor,obj))
 						continue;
 						continue;
 					try
 					try
 					{
 					{
@@ -2014,7 +2009,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 				int range = 0;
 				int range = 0;
 				for(L2Character obj: _actor.getKnownList().getKnownCharactersInRadius(range))
 				for(L2Character obj: _actor.getKnownList().getKnownCharactersInRadius(range))
 				{
 				{
-					if(!(obj instanceof L2Attackable) || obj.isDead() || obj == null || !GeoData.getInstance().canSeeTarget(_actor,obj))
+					if(!(obj instanceof L2Attackable) || obj.isDead() || !GeoData.getInstance().canSeeTarget(_actor,obj))
 						continue;
 						continue;
 					
 					
 					L2Attackable targets = ((L2Attackable)obj);
 					L2Attackable targets = ((L2Attackable)obj);

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/ai/L2FortSiegeGuardAI.java

@@ -137,7 +137,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
 				player = ((L2PcInstance)target);
 				player = ((L2PcInstance)target);
 			else if (target instanceof L2Summon)
 			else if (target instanceof L2Summon)
 				player = ((L2Summon) target).getOwner();
 				player = ((L2Summon) target).getOwner();
-			if (player == null || (player != null && player.getClan() != null && player.getClan().getHasFort() == ((L2Npc) _actor).getFort().getFortId()))
+			if (player == null || (player.getClan() != null && player.getClan().getHasFort() == ((L2Npc) _actor).getFort().getFortId()))
 				return false;
 				return false;
 		}
 		}
 		
 		

+ 2 - 5
L2_GameServer/java/com/l2jserver/gameserver/ai/L2PlayerAI.java

@@ -238,11 +238,8 @@ public class L2PlayerAI extends L2PlayableAI
 			return;
 			return;
 		if (checkTargetLostOrDead(target))
 		if (checkTargetLostOrDead(target))
 		{
 		{
-			if (target != null)
-			{
-				// Notify the target
-				setAttackTarget(null);
-			}
+			// Notify the target
+			setAttackTarget(null);
 			return;
 			return;
 		}
 		}
 		if (maybeMoveToPawn(target, _actor.getPhysicalAttackRange()))
 		if (maybeMoveToPawn(target, _actor.getPhysicalAttackRange()))

+ 8 - 18
L2_GameServer/java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java

@@ -230,29 +230,19 @@ public class RegionBBSManager extends BaseBBSManager
 					_logChat.log(record);
 					_logChat.log(record);
 				}
 				}
 				CreatureSay cs = new CreatureSay(activeChar.getObjectId(), Say2.TELL, activeChar.getName(), ar3);
 				CreatureSay cs = new CreatureSay(activeChar.getObjectId(), Say2.TELL, activeChar.getName(), ar3);
-				if (receiver != null)
+				if (!receiver.isSilenceMode() && !BlockList.isBlocked(receiver, activeChar) )
 				{
 				{
-					if (!receiver.isSilenceMode() && !BlockList.isBlocked(receiver, activeChar) )
-					{
-						receiver.sendPacket(cs);
-						activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), Say2.TELL, "->" + receiver.getName(), ar3));
-						StringUtil.append(htmlCode, "Message Sent<br><button value=\"Back\" action=\"bypass _bbsloc;playerinfo;", receiver.getName(), "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
-								+ "</td></tr></table></body></html>");
-						separateAndSend(htmlCode.toString(), activeChar);
-					}
-					else
-					{
-						SystemMessage sm = new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE);
-						activeChar.sendPacket(sm);
-						parsecmd("_bbsloc;playerinfo;" + receiver.getName(), activeChar);
-					}
+					receiver.sendPacket(cs);
+					activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), Say2.TELL, "->" + receiver.getName(), ar3));
+					StringUtil.append(htmlCode, "Message Sent<br><button value=\"Back\" action=\"bypass _bbsloc;playerinfo;", receiver.getName(), "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
+							+ "</td></tr></table></body></html>");
+					separateAndSend(htmlCode.toString(), activeChar);
 				}
 				}
 				else
 				else
 				{
 				{
-					SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_NOT_ONLINE);
-					sm.addString(ar2);
+					SystemMessage sm = new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE);
 					activeChar.sendPacket(sm);
 					activeChar.sendPacket(sm);
-					sm = null;
+					parsecmd("_bbsloc;playerinfo;" + receiver.getName(), activeChar);
 				}
 				}
 			}
 			}
 			catch (StringIndexOutOfBoundsException e)
 			catch (StringIndexOutOfBoundsException e)

+ 4 - 4
L2_GameServer/java/com/l2jserver/gameserver/datatables/SkillTreeTable.java

@@ -428,7 +428,7 @@ public class SkillTreeTable
 		
 		
 		skills.addAll(_fishingSkillTrees);
 		skills.addAll(_fishingSkillTrees);
 		
 		
-		if (skills == null)
+		if (skills.size() < 1)
 		{
 		{
 			// the skilltree for this class is undefined, so we give an empty list
 			// the skilltree for this class is undefined, so we give an empty list
 			_log.warning("Skilltree for fishing is not defined !");
 			_log.warning("Skilltree for fishing is not defined !");
@@ -480,7 +480,7 @@ public class SkillTreeTable
 		
 		
 		skills.addAll(_specialSkillTrees);
 		skills.addAll(_specialSkillTrees);
 		
 		
-		if (skills == null)
+		if (skills.size() < 1)
 		{
 		{
 			// the skilltree for this class is undefined, so we give an empty list
 			// the skilltree for this class is undefined, so we give an empty list
 			_log.warning("Skilltree for special is not defined !");
 			_log.warning("Skilltree for special is not defined !");
@@ -648,7 +648,7 @@ public class SkillTreeTable
 		
 		
 		skills.addAll(_fishingSkillTrees);
 		skills.addAll(_fishingSkillTrees);
 		
 		
-		if (skills == null)
+		if (skills.size() < 1)
 		{
 		{
 			// the skilltree for this class is undefined, so we give an empty list
 			// the skilltree for this class is undefined, so we give an empty list
 			_log.warning("SkillTree for fishing is not defined !");
 			_log.warning("SkillTree for fishing is not defined !");
@@ -677,7 +677,7 @@ public class SkillTreeTable
 		
 		
 		skills.addAll(_TransformSkillTrees);
 		skills.addAll(_TransformSkillTrees);
 		
 		
-		if (skills == null)
+		if (skills.size() < 1)
 		{
 		{
 			// the skilltree for this class is undefined, so we give an empty list
 			// the skilltree for this class is undefined, so we give an empty list
 			_log.warning("SkillTree for fishing is not defined !");
 			_log.warning("SkillTree for fishing is not defined !");

+ 1 - 2
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java

@@ -467,8 +467,7 @@ public class CastleManorManager
 
 
 			// Sending notification to a clan leader
 			// Sending notification to a clan leader
 			L2PcInstance clanLeader = null;
 			L2PcInstance clanLeader = null;
-			if (clan != null)
-				clanLeader = L2World.getInstance().getPlayer(clan.getLeader().getName());
+			clanLeader = L2World.getInstance().getPlayer(clan.getLeader().getName());
 			if (clanLeader != null)
 			if (clanLeader != null)
 				clanLeader.sendPacket(new SystemMessage(SystemMessageId.THE_MANOR_INFORMATION_HAS_BEEN_UPDATED));
 				clanLeader.sendPacket(new SystemMessage(SystemMessageId.THE_MANOR_INFORMATION_HAS_BEEN_UPDATED));
 
 

+ 2 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/ChanceSkillList.java

@@ -190,10 +190,11 @@ public class ChanceSkillList extends FastMap<IChanceSkillTrigger, ChanceConditio
 				return;
 				return;
 
 
 			L2Skill triggered = SkillTable.getInstance().getInfo(effect.getTriggeredChanceId(), effect.getTriggeredChanceLevel());
 			L2Skill triggered = SkillTable.getInstance().getInfo(effect.getTriggeredChanceId(), effect.getTriggeredChanceLevel());
+			if (triggered == null)
+				return;
 			L2Character caster = triggered.getTargetType() == L2Skill.SkillTargetType.TARGET_SELF ? _owner : effect.getEffector();
 			L2Character caster = triggered.getTargetType() == L2Skill.SkillTargetType.TARGET_SELF ? _owner : effect.getEffector();
 
 
 			if (caster == null
 			if (caster == null
-					|| triggered == null
 					|| triggered.getSkillType() == L2SkillType.NOTDONE
 					|| triggered.getSkillType() == L2SkillType.NOTDONE
 					|| caster.isSkillDisabled(triggered))
 					|| caster.isSkillDisabled(triggered))
 				return;
 				return;

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/CharEffectList.java

@@ -872,7 +872,7 @@ public class CharEffectList
 		_stackedEffects.put(newEffect.getStackType(), stackQueue);
 		_stackedEffects.put(newEffect.getStackType(), stackQueue);
 
 
 		// Get the first stacked effect of the Stack group selected
 		// Get the first stacked effect of the Stack group selected
-		if (stackQueue != null && !stackQueue.isEmpty())
+		if (!stackQueue.isEmpty())
 		{
 		{
 			effectToAdd = listsContains(stackQueue.get(0));
 			effectToAdd = listsContains(stackQueue.get(0));
 		}
 		}

+ 2 - 13
L2_GameServer/java/com/l2jserver/gameserver/model/L2Skill.java

@@ -1412,19 +1412,8 @@ public abstract class L2Skill implements IChanceSkillTrigger
             case TARGET_FRONT_AREA:
             case TARGET_FRONT_AREA:
             case TARGET_BEHIND_AREA:
             case TARGET_BEHIND_AREA:
             {
             {
-                if ((!(target instanceof L2Attackable || target instanceof L2Playable)) ||  // Target
-																									// is
-																									// not
-																									// L2Attackable
-																									// or
-																									// L2PlayableInstance
-                    (getCastRange() >= 0 && (target == null || target == activeChar || target.isAlikeDead()))) // target
-																												// is
-																												// null
-																												// or
-																												// self
-																												// or
-																												// dead/faking
+                if (((target == null || target == activeChar || target.isAlikeDead()) && getCastRange() >= 0) ||
+                		(!(target instanceof L2Attackable || target instanceof L2Playable)))
                 {
                 {
                     activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
                     activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
                     return _emptyTargetList;
                     return _emptyTargetList;

+ 1 - 2
L2_GameServer/java/com/l2jserver/gameserver/model/L2UIKeysSettings.java

@@ -113,8 +113,7 @@ public class L2UIKeysSettings
 		
 		
 		try
 		try
 		{
 		{
-			if (con == null)
-				con = L2DatabaseFactory.getInstance().getConnection();
+			con = L2DatabaseFactory.getInstance().getConnection();
 			
 			
 			statement = con.prepareStatement(query);
 			statement = con.prepareStatement(query);
 			statement.execute();
 			statement.execute();

+ 2 - 2
L2_GameServer/java/com/l2jserver/gameserver/model/actor/stat/CharStat.java

@@ -80,7 +80,7 @@ public class CharStat
 	 */
 	 */
 	public final double calcStat(Stats stat, double init, L2Character target, L2Skill skill)
 	public final double calcStat(Stats stat, double init, L2Character target, L2Skill skill)
 	{
 	{
-		if (_activeChar == null)
+		if (_activeChar == null || stat == null)
 			return init;
 			return init;
 		
 		
 		int id = stat.ordinal();
 		int id = stat.ordinal();
@@ -100,7 +100,7 @@ public class CharStat
 		// Launch the calculation
 		// Launch the calculation
 		c.calc(env);
 		c.calc(env);
 		// avoid some troubles with negative stats (some stats should never be negative)
 		// avoid some troubles with negative stats (some stats should never be negative)
-		if (env.value <= 0 && stat != null)
+		if (env.value <= 0)
 		{
 		{
 			switch(stat)
 			switch(stat)
 			{
 			{

+ 4 - 8
L2_GameServer/java/com/l2jserver/gameserver/model/entity/Castle.java

@@ -660,14 +660,10 @@ public class Castle
 		L2DoorInstance door = getDoor(doorId);
 		L2DoorInstance door = getDoor(doorId);
 		if (door == null)
 		if (door == null)
 			return;
 			return;
-		
-		if (door != null && door.getDoorId() == doorId)
-		{
-			door.setCurrentHp(door.getMaxHp() + hp);
-			
-			saveDoorUpgrade(doorId, hp, pDef, mDef);
-			return;
-		}
+
+		door.setCurrentHp(door.getMaxHp() + hp);
+
+		saveDoorUpgrade(doorId, hp, pDef, mDef);
 	}
 	}
 	
 	
 	// =========================================================
 	// =========================================================

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java

@@ -488,7 +488,7 @@ public class MultiSellChoose extends L2GameClientPacket
 		su = null;
 		su = null;
 		
 		
 		// finally, give the tax to the castle...
 		// finally, give the tax to the castle...
-		if (merchant != null && merchant.getIsInTown() && merchant.getCastle().getOwnerId() > 0)
+		if (merchant.getIsInTown() && merchant.getCastle().getOwnerId() > 0)
 			merchant.getCastle().addToTreasury(_transactionTax * _amount);
 			merchant.getCastle().addToTreasury(_transactionTax * _amount);
 		
 		
 		FastList.recycle(augmentation);
 		FastList.recycle(augmentation);

+ 2 - 12
L2_GameServer/java/com/l2jserver/gameserver/skills/Formulas.java

@@ -1291,12 +1291,7 @@ public final class Formulas
 
 
 		// Def bonusses in PvP fight
 		// Def bonusses in PvP fight
 		if(isPvP)
 		if(isPvP)
-		{
-			if(skill == null)
-				defence *= target.calcStat(Stats.PVP_PHYSICAL_DEF, 1, null, null);
-			else
-				defence *= target.calcStat(Stats.PVP_PHYS_SKILL_DEF, 1, null, null);	
-		}
+			defence *= target.calcStat(Stats.PVP_PHYS_SKILL_DEF, 1, null, null);	
 
 
 		if(ss)
 		if(ss)
 			damage *= 2.;
 			damage *= 2.;
@@ -1329,12 +1324,7 @@ public final class Formulas
 		
 		
 		// Dmg bonusses in PvP fight
 		// Dmg bonusses in PvP fight
 		if(isPvP)
 		if(isPvP)
-		{
-			if(skill == null)
-				damage *= attacker.calcStat(Stats.PVP_PHYSICAL_DMG, 1, null, null);
-			else
-				damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null);	
-		}
+			damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null);	
 		else if (target instanceof L2Attackable && !target.isRaid() && !target.isRaidMinion()
 		else if (target instanceof L2Attackable && !target.isRaid() && !target.isRaidMinion()
 				&& target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY && attacker.getActingPlayer() != null
 				&& target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY && attacker.getActingPlayer() != null
 				&& (target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2)
 				&& (target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2)

+ 8 - 12
L2_GameServer/java/com/l2jserver/i18n/LanguageControl.java

@@ -17,7 +17,6 @@ package com.l2jserver.i18n;
 import java.io.BufferedInputStream;
 import java.io.BufferedInputStream;
 import java.io.FileInputStream;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.IOException;
-import java.io.InputStream;
 import java.util.Locale;
 import java.util.Locale;
 import java.util.PropertyResourceBundle;
 import java.util.PropertyResourceBundle;
 import java.util.ResourceBundle;
 import java.util.ResourceBundle;
@@ -54,18 +53,15 @@ public class LanguageControl extends Control
 			format = "properties";
 			format = "properties";
 			String bundleName = toBundleName(baseName, locale);
 			String bundleName = toBundleName(baseName, locale);
 			String resourceName = LANGUAGES_DIRECTORY + toResourceName(bundleName, format);
 			String resourceName = LANGUAGES_DIRECTORY + toResourceName(bundleName, format);
-			InputStream stream = new FileInputStream(resourceName);
-			if (stream != null)
+			BufferedInputStream bis = null;
+			try
 			{
 			{
-				BufferedInputStream bis = new BufferedInputStream(stream);
-				try
-				{
-					bundle = new PropertyResourceBundle(bis);
-				}
-				finally
-				{
-					bis.close();
-				}
+				bis = new BufferedInputStream(new FileInputStream(resourceName));
+				bundle = new PropertyResourceBundle(bis);
+			}
+			finally
+			{
+				bis.close();
 			}
 			}
 		}
 		}
 		return bundle;
 		return bundle;

+ 9 - 9
L2_GameServer/java/com/l2jserver/loginserver/LoginController.java

@@ -573,7 +573,7 @@ public class LoginController
 		InetAddress address = client.getConnection().getInetAddress();
 		InetAddress address = client.getConnection().getInetAddress();
 		
 		
 		// player disconnected meanwhile
 		// player disconnected meanwhile
-		if (address == null)
+		if (address == null || user == null)
 		{
 		{
 			return false;
 			return false;
 		}
 		}
@@ -625,14 +625,14 @@ public class LoginController
 						statement.close();
 						statement.close();
 						
 						
 						if (Config.LOG_LOGIN_CONTROLLER)
 						if (Config.LOG_LOGIN_CONTROLLER)
-							Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + " - OK : AccountCreate", "loginlog");
+							Log.add("'" + user + "' " + address.getHostAddress() + " - OK : AccountCreate", "loginlog");
 						
 						
 						_log.info("Created new account for " + user);
 						_log.info("Created new account for " + user);
 						return true;
 						return true;
 						
 						
 					}
 					}
 					if (Config.LOG_LOGIN_CONTROLLER)
 					if (Config.LOG_LOGIN_CONTROLLER)
-						Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + " - ERR : ErrCreatingACC", "loginlog");
+						Log.add("'" + user + "' " + address.getHostAddress() + " - ERR : ErrCreatingACC", "loginlog");
 
 
 					_log.warning("Invalid username creation/use attempt: " + user);
 					_log.warning("Invalid username creation/use attempt: " + user);
 					return false;
 					return false;
@@ -640,7 +640,7 @@ public class LoginController
 				else 
 				else 
 				{
 				{
 					if (Config.LOG_LOGIN_CONTROLLER)
 					if (Config.LOG_LOGIN_CONTROLLER)
-						Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + " - ERR : AccountMissing", "loginlog");
+						Log.add("'" + user + "' " + address.getHostAddress() + " - ERR : AccountMissing", "loginlog");
 
 
 					_log.warning("Account missing for user " + user);
 					_log.warning("Account missing for user " + user);
 					FailedLoginAttempt failedAttempt = _hackProtection.get(address);
 					FailedLoginAttempt failedAttempt = _hackProtection.get(address);
@@ -671,16 +671,16 @@ public class LoginController
 				if (access < 0)
 				if (access < 0)
 				{
 				{
 					if (Config.LOG_LOGIN_CONTROLLER)
 					if (Config.LOG_LOGIN_CONTROLLER)
-						Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + " - ERR : AccountBanned", "loginlog");
+						Log.add("'" + user + "' " + address.getHostAddress() + " - ERR : AccountBanned", "loginlog");
 				
 				
 					client.setAccessLevel(access);
 					client.setAccessLevel(access);
 					return false;
 					return false;
 				}
 				}
 				// Check IP
 				// Check IP
-				if ( address != null && userIP != null && !address.getHostAddress().equalsIgnoreCase(userIP))
+				if (userIP != null && !address.getHostAddress().equalsIgnoreCase(userIP))
 				{
 				{
 					if (Config.LOG_LOGIN_CONTROLLER)
 					if (Config.LOG_LOGIN_CONTROLLER)
-						Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + "/" + userIP + " - ERR : INCORRECT IP", "loginlog");
+						Log.add("'" + user + "' " + address.getHostAddress() + "/" + userIP + " - ERR : INCORRECT IP", "loginlog");
 					
 					
 					return false;
 					return false;
 				}
 				}
@@ -727,7 +727,7 @@ public class LoginController
 		if (!ok)
 		if (!ok)
 		{
 		{
 			if (Config.LOG_LOGIN_CONTROLLER)
 			if (Config.LOG_LOGIN_CONTROLLER)
-				Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + " - ERR : LoginFailed", "loginlog");
+				Log.add("'" + user + "' " + address.getHostAddress() + " - ERR : LoginFailed", "loginlog");
 			
 			
 			FailedLoginAttempt failedAttempt = _hackProtection.get(address);
 			FailedLoginAttempt failedAttempt = _hackProtection.get(address);
 			int failedCount;
 			int failedCount;
@@ -753,7 +753,7 @@ public class LoginController
 		{
 		{
 			_hackProtection.remove(address);
 			_hackProtection.remove(address);
 			if (Config.LOG_LOGIN_CONTROLLER)
 			if (Config.LOG_LOGIN_CONTROLLER)
-				Log.add("'" + (user == null ? "null" : user) + "' " + (address == null ? "null" : address.getHostAddress()) + " - OK : LoginOk", "loginlog");
+				Log.add("'" + user + "' " + address.getHostAddress() + " - OK : LoginOk", "loginlog");
 		}
 		}
 		
 		
 		return ok;
 		return ok;