From 869c4311fb3216a9d733a57bec4ffaff4af05694 Mon Sep 17 00:00:00 2001 From: Phergus <34379254+Phergus@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:42:45 -0700 Subject: [PATCH 1/2] Misc fixes for protobuf migration AppActions - showError() call incorrectly using t.getCause() MapTool - log.error() was using message key and not the message string. Zone - added check for aStarRounding being null to readResolve(). --- src/main/java/net/rptools/maptool/client/AppActions.java | 2 +- src/main/java/net/rptools/maptool/client/MapTool.java | 2 +- src/main/java/net/rptools/maptool/model/Zone.java | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/rptools/maptool/client/AppActions.java b/src/main/java/net/rptools/maptool/client/AppActions.java index 9ccf57058f..340beb2e49 100644 --- a/src/main/java/net/rptools/maptool/client/AppActions.java +++ b/src/main/java/net/rptools/maptool/client/AppActions.java @@ -2666,7 +2666,7 @@ protected void done() { if (t.getCause() instanceof AppState.FailedToAcquireLockException) { MapTool.showError("msg.error.failedLoadCampaignLock"); } else { - MapTool.showError("msg.error.failedLoadCampaign", t.getCause()); + MapTool.showError("msg.error.failedLoadCampaign", t); } } } diff --git a/src/main/java/net/rptools/maptool/client/MapTool.java b/src/main/java/net/rptools/maptool/client/MapTool.java index be5976dd7f..fef69cdfcc 100644 --- a/src/main/java/net/rptools/maptool/client/MapTool.java +++ b/src/main/java/net/rptools/maptool/client/MapTool.java @@ -293,7 +293,7 @@ public static void showError(String msgKey) { */ public static void showError(String msgKey, Throwable t) { String msg = generateMessage(msgKey, t); - log.error(msgKey, t); + log.error(I18N.getString(msgKey), t); showMessage(msg, "msg.title.messageDialogError", JOptionPane.ERROR_MESSAGE); } diff --git a/src/main/java/net/rptools/maptool/model/Zone.java b/src/main/java/net/rptools/maptool/model/Zone.java index b44fa713f5..0437b68d25 100644 --- a/src/main/java/net/rptools/maptool/model/Zone.java +++ b/src/main/java/net/rptools/maptool/model/Zone.java @@ -2109,6 +2109,10 @@ protected Object readResolve() { if (topologyTerrain == null) { topologyTerrain = new Area(); } + + if (aStarRounding == null) { + aStarRounding = AStarRoundingOptions.NONE; + } return this; } From 343f300eb80e6952dc915ec284063079ce1847ea Mon Sep 17 00:00:00 2001 From: Phergus <34379254+Phergus@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:48:05 -0700 Subject: [PATCH 2/2] Update AppActions.java Spotless! --- src/main/java/net/rptools/maptool/client/AppActions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/rptools/maptool/client/AppActions.java b/src/main/java/net/rptools/maptool/client/AppActions.java index 340beb2e49..85375deadf 100644 --- a/src/main/java/net/rptools/maptool/client/AppActions.java +++ b/src/main/java/net/rptools/maptool/client/AppActions.java @@ -2666,7 +2666,7 @@ protected void done() { if (t.getCause() instanceof AppState.FailedToAcquireLockException) { MapTool.showError("msg.error.failedLoadCampaignLock"); } else { - MapTool.showError("msg.error.failedLoadCampaign", t); + MapTool.showError("msg.error.failedLoadCampaign", t); } } }