forked from qt-creator/qt-creator
VcsBase: Ensure context not null inside vcsExecWithHandler()
When passed context is null use VcsBaseClientImpl as a context.
Amends 287a7c9268
Change-Id: I5817d74207683ae000fc2662920af2d1ff23d5ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -170,7 +170,8 @@ void VcsBaseClientImpl::vcsExecWithHandler(const FilePath &workingDirectory,
|
|||||||
command->addFlags(additionalFlags);
|
command->addFlags(additionalFlags);
|
||||||
command->addJob({vcsBinary(), arguments}, vcsTimeoutS());
|
command->addJob({vcsBinary(), arguments}, vcsTimeoutS());
|
||||||
if (handler) {
|
if (handler) {
|
||||||
connect(command, &VcsCommand::done, context, [command, handler] {
|
const QObject *actualContext = context ? context : this;
|
||||||
|
connect(command, &VcsCommand::done, actualContext, [command, handler] {
|
||||||
handler(CommandResult(*command));
|
handler(CommandResult(*command));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user