mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Task: Segfault protection
This commit is contained in:
parent
23318103ed
commit
4e9ec1b320
1 changed files with 6 additions and 4 deletions
10
src/Task.cpp
10
src/Task.cpp
|
@ -25,6 +25,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <iostream> // TODO Remove
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
@ -1969,6 +1970,8 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
{
|
||||
if (a._lextype == Lexer::Type::pair)
|
||||
{
|
||||
// std::cout << "# Task::modify " << a.dump () << "\n";
|
||||
|
||||
// 'canonical' is the canonical name. Needs to be said.
|
||||
// 'value' requires eval.
|
||||
std::string name = a.attribute ("canonical");
|
||||
|
@ -1987,11 +1990,10 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
{
|
||||
Lexer::dequote (value);
|
||||
|
||||
// Get the column info.
|
||||
// Get the column info. Some columns are not modifiable.
|
||||
Column* column = context.columns[name];
|
||||
|
||||
// Some columns are not modifiable.
|
||||
if (! column->modifiable ())
|
||||
if (! column ||
|
||||
! column->modifiable ())
|
||||
throw format (STRING_INVALID_MOD, name, value);
|
||||
|
||||
// Dependencies are specified as IDs.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue