Skip to content

Commit 0957c13

Browse files
jcollins-gcommit-bot@chromium.org
authored andcommitted
Check for null before dereferencing constraint text.
Bug: #38839 Change-Id: I63104ec32d871a61f7e5f65e605ea01faf0d2aaf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124464 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Janice Collins <jcollins@google.com> Auto-Submit: Janice Collins <jcollins@google.com>
1 parent fd9f79c commit 0957c13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4376,10 +4376,10 @@ class FixProcessor extends BaseProcessor {
43764376
SdkConstraintExtractor extractor = new SdkConstraintExtractor(pubspecFile);
43774377
String text = extractor.constraintText();
43784378
int offset = extractor.constraintOffset();
4379-
int length = text.length;
43804379
if (text == null || offset < 0) {
43814380
return;
43824381
}
4382+
int length = text.length;
43834383
String newText;
43844384
int spaceOffset = text.indexOf(' ');
43854385
if (spaceOffset >= 0) {

0 commit comments

Comments
 (0)