Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/src/relationship_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ List<Relationship>? relationshipsFor(
// Since mixins do not support inheritance, we only care about
// methods that exist on classes
if (node is MethodDeclaration && node.parent is ClassDeclaration) {
final parentNode = node.parent as ClassDeclaration;
final parentElement = parentNode.declaredElement as ClassElement;
final parentNode = node.parent as ClassDeclaration?;
final parentElement = parentNode?.declaredElement;

// this shouldn't happen, but if the parent element happens to be
// null, just fail fast
if (parentElement == null) return null;

// retrieve all of the methods and accessors of every parent type that
// has the same name of [node]. These are the elements that this [node]
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ packages:
dependency: "direct dev"
description:
name: workiva_analysis_options
sha256: "428e75a330786b519c87409530c52a1f366731af2cf94fe6da85582889d583bc"
sha256: d7b1b88c2e4c5f795c56f40940583fa2de40510a23ef494a29db32699af52a3d
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.1"
yaml:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ dev_dependencies:
dart_dev: ^4.0.2
dependency_validator: ^3.2.3
glob: ^2.1.1
workiva_analysis_options: ^1.0.0
workiva_analysis_options: ^1.4.1