unnecessary null comparison (#67525)
This commit is contained in:
committed by
GitHub
parent
0b78110b26
commit
0d8d4f77aa
@@ -42,8 +42,7 @@ DriverError _createInvalidKeyValueTypeError(String invalidType) {
|
||||
abstract class CommandWithTarget extends Command {
|
||||
/// Constructs this command given a [finder].
|
||||
CommandWithTarget(this.finder, {Duration timeout}) : super(timeout: timeout) {
|
||||
if (finder == null)
|
||||
throw DriverError('$runtimeType target cannot be null');
|
||||
assert(finder != null, '$runtimeType target cannot be null');
|
||||
}
|
||||
|
||||
/// Deserializes this command from the value generated by [serialize].
|
||||
|
||||
@@ -164,13 +164,7 @@ class _InternalCombinedCondition implements WaitCondition {
|
||||
if (condition.conditionName != 'CombinedCondition')
|
||||
throw SerializationException('Error occurred during deserializing from the given condition: ${condition.serialize()}');
|
||||
final CombinedCondition combinedCondition = condition as CombinedCondition;
|
||||
if (combinedCondition.conditions == null) {
|
||||
return const _InternalCombinedCondition(<WaitCondition>[]);
|
||||
}
|
||||
|
||||
final List<WaitCondition> conditions = combinedCondition.conditions.map(
|
||||
(SerializableWaitCondition serializableCondition) => deserializeCondition(serializableCondition)
|
||||
).toList();
|
||||
final List<WaitCondition> conditions = combinedCondition.conditions.map(deserializeCondition).toList();
|
||||
return _InternalCombinedCondition(conditions);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user