Skip to content

Commit 32c7fcc

Browse files
Toshio Nakamuradmarkov20
Toshio Nakamura
authored andcommitted
8263490: [macos] Crash occurs on JPasswordField with activated InputMethod
Reviewed-by: dmarkov, serb, kizune
1 parent 8afec70 commit 32c7fcc

File tree

1 file changed

+5
-1
lines changed
  • src/java.desktop/macosx/native/libawt_lwawt/awt

1 file changed

+5
-1
lines changed

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1164,8 +1164,12 @@ - (NSAttributedString *) attributedSubstringForProposedRange:(NSRange)theRange a
11641164
#ifdef IM_DEBUG
11651165
fprintf(stderr, "AWTView InputMethod Selector Called : [attributedSubstringFromRange] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length);
11661166
#endif // IM_DEBUG
1167+
if (!fInputMethodLOCKABLE) {
1168+
return nil;
1169+
}
11671170

11681171
JNIEnv *env = [ThreadUtilities getJNIEnv];
1172+
GET_CIM_CLASS_RETURN(nil);
11691173
DECLARE_METHOD_RETURN(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;", nil);
11701174
jobject theString = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length);
11711175
CHECK_EXCEPTION_NULL_RETURN(theString, nil);

0 commit comments

Comments
 (0)