From e2c4430d891300abcbd66ef17ac1f9ca2b6fc292 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Tue, 23 Jul 2013 19:56:05 +0900
Subject: [PATCH] Fix called C++ object pointer is null
---
src/kits/storage/disk_device/jobs/SetStringJob.cpp | 37 +++++++++++++-------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/kits/storage/disk_device/jobs/SetStringJob.cpp b/src/kits/storage/disk_device/jobs/SetStringJob.cpp
index 77d82c3..ef17001 100644
a
|
b
|
SetStringJob::Do()
|
62 | 62 | |
63 | 63 | switch (fJobType) { |
64 | 64 | case B_DISK_DEVICE_JOB_SET_NAME: |
65 | | error = _kern_set_partition_name(fPartition->PartitionID(), |
66 | | &changeCounter, fChild->PartitionID(), &childChangeCounter, |
67 | | fString); |
68 | | updateChildChangeCounter = true; |
| 65 | if(fChild == NULL) { |
| 66 | return B_BAD_VALUE; |
| 67 | } else { |
| 68 | error = _kern_set_partition_name(fPartition->PartitionID(), |
| 69 | &changeCounter, fChild->PartitionID(), &childChangeCounter, |
| 70 | fString); |
| 71 | updateChildChangeCounter = true; |
| 72 | } |
69 | 73 | break; |
70 | 74 | case B_DISK_DEVICE_JOB_SET_CONTENT_NAME: |
71 | 75 | error = _kern_set_partition_content_name(fPartition->PartitionID(), |
72 | 76 | &changeCounter, fString); |
73 | 77 | break; |
74 | 78 | case B_DISK_DEVICE_JOB_SET_TYPE: |
75 | | error = _kern_set_partition_type(fPartition->PartitionID(), |
76 | | &changeCounter, fChild->PartitionID(), &childChangeCounter, |
77 | | fString); |
78 | | updateChildChangeCounter = true; |
| 79 | if(fChild == NULL) { |
| 80 | return B_BAD_VALUE; |
| 81 | } else { |
| 82 | error = _kern_set_partition_type(fPartition->PartitionID(), |
| 83 | &changeCounter, fChild->PartitionID(), &childChangeCounter, |
| 84 | fString); |
| 85 | updateChildChangeCounter = true; |
| 86 | } |
79 | 87 | break; |
80 | 88 | case B_DISK_DEVICE_JOB_SET_PARAMETERS: |
81 | | error = _kern_set_partition_parameters(fPartition->PartitionID(), |
82 | | &changeCounter, fChild->PartitionID(), &childChangeCounter, |
83 | | fString); |
84 | | updateChildChangeCounter = true; |
| 89 | if(fChild == NULL) { |
| 90 | return B_BAD_VALUE; |
| 91 | } else { |
| 92 | error = _kern_set_partition_parameters( |
| 93 | fPartition->PartitionID(), &changeCounter, |
| 94 | fChild->PartitionID(), &childChangeCounter, |
| 95 | fString); |
| 96 | updateChildChangeCounter = true; |
| 97 | } |
85 | 98 | break; |
86 | 99 | case B_DISK_DEVICE_JOB_SET_CONTENT_PARAMETERS: |
87 | 100 | error = _kern_set_partition_content_parameters( |