Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jitsi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZRTP
jitsi
Commits
ae96e602
Commit
ae96e602
authored
10 years ago
by
Danny van Heumen
Browse files
Options
Downloads
Patches
Plain Diff
Gracefully handle race (NPE)
parent
86d38051
Branches
fix-message-formatting
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
+26
-8
26 additions, 8 deletions
...ommunicator/impl/gui/main/chat/ChatConversationPanel.java
with
26 additions
and
8 deletions
src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java
+
26
−
8
View file @
ae96e602
...
...
@@ -2107,11 +2107,21 @@ private ReplacementWorker(final String messageID,
@Override
public
void
finished
()
{
ShowPreviewDialog
previewDialog
=
showPreview
;
// There is a race between the replacement worker and the
// ChatConversationPanel when it is (being) disposed of. Make sure
// we have an instance before continuing.
if
(
previewDialog
==
null
)
{
// Abort if dialog has been disposed of.
return
;
}
String
newMessage
=
(
String
)
get
();
if
(
newMessage
!=
null
&&
!
newMessage
.
equals
(
chatString
))
{
showP
review
.
getMsgIDToChatString
().
put
(
p
review
Dialog
.
getMsgIDToChatString
().
put
(
messageID
,
newMessage
);
synchronized
(
scrollToBottomRunnable
)
{
...
...
@@ -2229,6 +2239,16 @@ private void processText(final String plainText,
final
ReplacementService
rService
,
final
boolean
isURL
)
{
final
ShowPreviewDialog
previewDialog
=
showPreview
;
// There is a race between the replacement worker and the
// ChatConversationPanel when it is (being) disposed of. Make sure
// we have an instance before continuing.
if
(
previewDialog
==
null
)
{
// Abort if dialog has been disposed of.
return
;
}
Matcher
m
=
pattern
.
matcher
(
plainText
);
ConfigurationService
cfg
=
GuiActivator
.
getConfigurationService
();
...
...
@@ -2276,7 +2296,7 @@ else if (isProposalEnabled)
{
msgBuff
.
append
(
StringEscapeUtils
.
escapeHtml4
(
group
));
msgBuff
.
append
(
"</A> <A href=\"jitsi://"
+
showP
review
.
getClass
().
getName
()
+
p
review
Dialog
.
getClass
().
getName
()
+
"/SHOWPREVIEW?"
+
messageID
+
"#"
+
linkCounter
...
...
@@ -2285,12 +2305,10 @@ else if (isProposalEnabled)
.
getResources
().
getI18NString
(
"service.gui.SHOW_PREVIEW"
)));
showPreview
.
getMsgIDandPositionToLink
()
.
put
(
messageID
+
"#"
+
linkCounter
++,
group
);
showPreview
.
getLinkToReplacement
()
.
put
(
group
,
temp
);
previewDialog
.
getMsgIDandPositionToLink
()
.
put
(
messageID
+
"#"
+
linkCounter
++,
group
);
previewDialog
.
getLinkToReplacement
()
.
put
(
group
,
temp
);
}
else
if
(
isEnabled
&&
isEnabledForSource
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment