Specifically handle StackOverflowError and add in missing checks for premium/config
This commit is contained in:
		| @@ -103,11 +103,18 @@ public class DisguiseUtilities { | ||||
|     } | ||||
|  | ||||
|     public static void saveDisguises() { | ||||
|         if (!LibsPremium.isPremium()) | ||||
|             return; | ||||
|  | ||||
|         for (HashSet<TargetedDisguise> list : disguisesInUse.values()) { | ||||
|             for (TargetedDisguise disg : list) { | ||||
|                 if (disg.getEntity() == null) | ||||
|                     continue; | ||||
|  | ||||
|                 if (disg.getEntity() instanceof Player ? DisguiseConfig.isSavePlayerDisguises() : | ||||
|                         DisguiseConfig.isSaveEntityDisguises()) | ||||
|                     continue; | ||||
|  | ||||
|                 saveDisguises(disg.getEntity().getUniqueId(), list.toArray(new Disguise[0])); | ||||
|                 break; | ||||
|             } | ||||
| @@ -188,7 +195,7 @@ public class DisguiseUtilities { | ||||
|                 savedDisguiseList.add(owningEntity); | ||||
|             } | ||||
|         } | ||||
|         catch (Exception e) { | ||||
|         catch (StackOverflowError | Exception e) { | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|     } | ||||
| @@ -327,8 +334,8 @@ public class DisguiseUtilities { | ||||
|  | ||||
|             cachedNames.add(string.toLowerCase()); | ||||
|         } | ||||
|         catch (Exception ex) { | ||||
|             ex.printStackTrace(); | ||||
|         catch (StackOverflowError | Exception e) { | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user