From 097742c13c75278f1683bdace21efa2605dd8401 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 11 Jun 2019 10:49:06 -0700 Subject: [PATCH] Fix missing return lint (flutter/engine#9246) A recent Dart roll improved the detection of missing return statements. Since we enforce that all enum values must be covered in switch statements, this isn't an issue, but we add a return to fix the lint. --- engine/src/flutter/ci/licenses_golden/tool_signature | 2 +- engine/src/flutter/tools/licenses/lib/licenses.dart | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/ci/licenses_golden/tool_signature b/engine/src/flutter/ci/licenses_golden/tool_signature index 1b97f5a8b2..bd4e546b73 100644 --- a/engine/src/flutter/ci/licenses_golden/tool_signature +++ b/engine/src/flutter/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: ad6590b867473860a1e6b08bf9e98667 +Signature: 5b10e36374c7d600de6c632fde955f7d diff --git a/engine/src/flutter/tools/licenses/lib/licenses.dart b/engine/src/flutter/tools/licenses/lib/licenses.dart index 64045f9699..dc1a18cb6d 100644 --- a/engine/src/flutter/tools/licenses/lib/licenses.dart +++ b/engine/src/flutter/tools/licenses/lib/licenses.dart @@ -176,6 +176,7 @@ abstract class License implements Comparable { if (!reformatted) body = _reformat(body); final License result = _registry.putIfAbsent(body, () { + assert(type != null); switch (type) { case LicenseType.bsd: case LicenseType.mit: @@ -200,6 +201,7 @@ abstract class License implements Comparable { case LicenseType.libpng: return BlankLicense._(body, type, origin: origin); } + return null; }); assert(result.type == type); return result;