[Command] Simplify the code and make it less error prone. NFCI.
Pointed out by Jim.
llvm-svn: 330047
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 5e2810e..fc62b39 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -623,10 +623,7 @@
if (expr == nullptr)
expr = command;
- Target *target = m_interpreter.GetExecutionContext().GetTargetPtr();
- if (!target)
- target = GetDummyTarget();
-
+ Target *target = GetSelectedOrDummyTarget();
if (EvaluateExpression(expr, &(result.GetOutputStream()),
&(result.GetErrorStream()), &result)) {